Average Error: 0.6 → 0.5
Time: 42.6s
Precision: 64
$-1 \lt m0 \lt 1 \land -1 \lt m1 \lt 1 \land -1 \lt m2 \lt 1 \land \frac{1}{100000} \lt w0 \lt 1 \land \frac{1}{100000} \lt w1 \lt 1 \land \frac{1}{100000} \lt w2 \lt 1 \land \frac{1}{100000} \lt a0 \lt 1 \land \frac{1}{100000} \lt a1 \lt 1 \land \frac{1}{100000} \lt a2 \lt 1$
$0 + \left(\left(\left(w0 \cdot \left(0 - m0\right)\right) \cdot \left(-3 \cdot \left(\left(1 \cdot \frac{a0}{w0}\right) \cdot \frac{a0}{w0}\right)\right)\right) \cdot 1 + \left(\left(\left(w1 \cdot \left(0 - m1\right)\right) \cdot \left(-3 \cdot \left(\left(1 \cdot \frac{a1}{w1}\right) \cdot \frac{a1}{w1}\right)\right)\right) \cdot 1 + \left(\left(\left(w2 \cdot \left(0 - m2\right)\right) \cdot \left(-3 \cdot \left(\left(1 \cdot \frac{a2}{w2}\right) \cdot \frac{a2}{w2}\right)\right)\right) \cdot 1 + 0\right)\right)\right)$
$\left(\left(\frac{a2}{w2} \cdot \frac{a2}{w2}\right) \cdot \left(3 \cdot \left(w2 \cdot m2\right)\right) + \frac{3 \cdot \left(a0 \cdot a0\right)}{\frac{w0}{m0}}\right) + \frac{3}{\frac{w1}{\left(a1 \cdot a1\right) \cdot m1}}$
0 + \left(\left(\left(w0 \cdot \left(0 - m0\right)\right) \cdot \left(-3 \cdot \left(\left(1 \cdot \frac{a0}{w0}\right) \cdot \frac{a0}{w0}\right)\right)\right) \cdot 1 + \left(\left(\left(w1 \cdot \left(0 - m1\right)\right) \cdot \left(-3 \cdot \left(\left(1 \cdot \frac{a1}{w1}\right) \cdot \frac{a1}{w1}\right)\right)\right) \cdot 1 + \left(\left(\left(w2 \cdot \left(0 - m2\right)\right) \cdot \left(-3 \cdot \left(\left(1 \cdot \frac{a2}{w2}\right) \cdot \frac{a2}{w2}\right)\right)\right) \cdot 1 + 0\right)\right)\right)
\left(\left(\frac{a2}{w2} \cdot \frac{a2}{w2}\right) \cdot \left(3 \cdot \left(w2 \cdot m2\right)\right) + \frac{3 \cdot \left(a0 \cdot a0\right)}{\frac{w0}{m0}}\right) + \frac{3}{\frac{w1}{\left(a1 \cdot a1\right) \cdot m1}}
double f(double m0, double m1, double m2, double w0, double w1, double w2, double a0, double a1, double a2) {
double r51918967 = 0.0;
double r51918968 = w0;
double r51918969 = m0;
double r51918970 = r51918967 - r51918969;
double r51918971 = r51918968 * r51918970;
double r51918972 = -3.0;
double r51918973 = 1.0;
double r51918974 = a0;
double r51918975 = r51918974 / r51918968;
double r51918976 = r51918973 * r51918975;
double r51918977 = r51918976 * r51918975;
double r51918978 = r51918972 * r51918977;
double r51918979 = r51918971 * r51918978;
double r51918980 = r51918979 * r51918973;
double r51918981 = w1;
double r51918982 = m1;
double r51918983 = r51918967 - r51918982;
double r51918984 = r51918981 * r51918983;
double r51918985 = a1;
double r51918986 = r51918985 / r51918981;
double r51918987 = r51918973 * r51918986;
double r51918988 = r51918987 * r51918986;
double r51918989 = r51918972 * r51918988;
double r51918990 = r51918984 * r51918989;
double r51918991 = r51918990 * r51918973;
double r51918992 = w2;
double r51918993 = m2;
double r51918994 = r51918967 - r51918993;
double r51918995 = r51918992 * r51918994;
double r51918996 = a2;
double r51918997 = r51918996 / r51918992;
double r51918998 = r51918973 * r51918997;
double r51918999 = r51918998 * r51918997;
double r51919000 = r51918972 * r51918999;
double r51919001 = r51918995 * r51919000;
double r51919002 = r51919001 * r51918973;
double r51919003 = r51919002 + r51918967;
double r51919004 = r51918991 + r51919003;
double r51919005 = r51918980 + r51919004;
double r51919006 = r51918967 + r51919005;
return r51919006;
}


double f(double m0, double m1, double m2, double w0, double w1, double w2, double a0, double a1, double a2) {
double r51919007 = a2;
double r51919008 = w2;
double r51919009 = r51919007 / r51919008;
double r51919010 = r51919009 * r51919009;
double r51919011 = 3.0;
double r51919012 = m2;
double r51919013 = r51919008 * r51919012;
double r51919014 = r51919011 * r51919013;
double r51919015 = r51919010 * r51919014;
double r51919016 = a0;
double r51919017 = r51919016 * r51919016;
double r51919018 = r51919011 * r51919017;
double r51919019 = w0;
double r51919020 = m0;
double r51919021 = r51919019 / r51919020;
double r51919022 = r51919018 / r51919021;
double r51919023 = r51919015 + r51919022;
double r51919024 = w1;
double r51919025 = a1;
double r51919026 = r51919025 * r51919025;
double r51919027 = m1;
double r51919028 = r51919026 * r51919027;
double r51919029 = r51919024 / r51919028;
double r51919030 = r51919011 / r51919029;
double r51919031 = r51919023 + r51919030;
return r51919031;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.6

$0 + \left(\left(\left(w0 \cdot \left(0 - m0\right)\right) \cdot \left(-3 \cdot \left(\left(1 \cdot \frac{a0}{w0}\right) \cdot \frac{a0}{w0}\right)\right)\right) \cdot 1 + \left(\left(\left(w1 \cdot \left(0 - m1\right)\right) \cdot \left(-3 \cdot \left(\left(1 \cdot \frac{a1}{w1}\right) \cdot \frac{a1}{w1}\right)\right)\right) \cdot 1 + \left(\left(\left(w2 \cdot \left(0 - m2\right)\right) \cdot \left(-3 \cdot \left(\left(1 \cdot \frac{a2}{w2}\right) \cdot \frac{a2}{w2}\right)\right)\right) \cdot 1 + 0\right)\right)\right)$
2. Simplified0.6

$\leadsto \color{blue}{\left(\left(m0 \cdot w0\right) \cdot \frac{3}{\frac{w0}{a0} \cdot \frac{w0}{a0}} + \left(\frac{a2}{w2} \cdot \frac{a2}{w2}\right) \cdot \left(3 \cdot \left(w2 \cdot m2\right)\right)\right) + \left(\left(m1 \cdot 3\right) \cdot w1\right) \cdot \left(\frac{a1}{w1} \cdot \frac{a1}{w1}\right)}$
3. Taylor expanded around inf 0.6

$\leadsto \left(\color{blue}{3 \cdot \frac{{a0}^{2} \cdot m0}{w0}} + \left(\frac{a2}{w2} \cdot \frac{a2}{w2}\right) \cdot \left(3 \cdot \left(w2 \cdot m2\right)\right)\right) + \left(\left(m1 \cdot 3\right) \cdot w1\right) \cdot \left(\frac{a1}{w1} \cdot \frac{a1}{w1}\right)$
4. Simplified0.6

$\leadsto \left(\color{blue}{\frac{\left(a0 \cdot a0\right) \cdot 3}{\frac{w0}{m0}}} + \left(\frac{a2}{w2} \cdot \frac{a2}{w2}\right) \cdot \left(3 \cdot \left(w2 \cdot m2\right)\right)\right) + \left(\left(m1 \cdot 3\right) \cdot w1\right) \cdot \left(\frac{a1}{w1} \cdot \frac{a1}{w1}\right)$
5. Taylor expanded around 0 0.5

$\leadsto \left(\frac{\left(a0 \cdot a0\right) \cdot 3}{\frac{w0}{m0}} + \left(\frac{a2}{w2} \cdot \frac{a2}{w2}\right) \cdot \left(3 \cdot \left(w2 \cdot m2\right)\right)\right) + \color{blue}{3 \cdot \frac{{a1}^{2} \cdot m1}{w1}}$
6. Simplified0.5

$\leadsto \left(\frac{\left(a0 \cdot a0\right) \cdot 3}{\frac{w0}{m0}} + \left(\frac{a2}{w2} \cdot \frac{a2}{w2}\right) \cdot \left(3 \cdot \left(w2 \cdot m2\right)\right)\right) + \color{blue}{\frac{3}{\frac{w1}{m1 \cdot \left(a1 \cdot a1\right)}}}$
7. Final simplification0.5

$\leadsto \left(\left(\frac{a2}{w2} \cdot \frac{a2}{w2}\right) \cdot \left(3 \cdot \left(w2 \cdot m2\right)\right) + \frac{3 \cdot \left(a0 \cdot a0\right)}{\frac{w0}{m0}}\right) + \frac{3}{\frac{w1}{\left(a1 \cdot a1\right) \cdot m1}}$

# Reproduce

herbie shell --seed 1
(FPCore (m0 m1 m2 w0 w1 w2 a0 a1 a2)
:name "test04_dqmom9"
:pre (and (< -1 m0 1) (< -1 m1 1) (< -1 m2 1) (< 1/100000 w0 1) (< 1/100000 w1 1) (< 1/100000 w2 1) (< 1/100000 a0 1) (< 1/100000 a1 1) (< 1/100000 a2 1))
(+ 0 (+ (* (* (* w0 (- 0 m0)) (* -3 (* (* 1 (/ a0 w0)) (/ a0 w0)))) 1) (+ (* (* (* w1 (- 0 m1)) (* -3 (* (* 1 (/ a1 w1)) (/ a1 w1)))) 1) (+ (* (* (* w2 (- 0 m2)) (* -3 (* (* 1 (/ a2 w2)) (/ a2 w2)))) 1) 0)))))