Average Error: 34.0 → 30.8
Time: 29.7s
Precision: 64
$\frac{a}{3.129999999999999893418589635984972119331 \cdot \left({\left(\frac{x}{2}\right)}^{2} - {\left(\frac{y}{2}\right)}^{2}\right)} \cdot \left(3 \cdot {\left(\frac{z}{2}\right)}^{2} - {\left(\frac{c}{2}\right)}^{2}\right)$
$\begin{array}{l} \mathbf{if}\;{\left(\frac{z}{2}\right)}^{2} \le 6.896059690657343268743834421449770620693 \cdot 10^{290}:\\ \;\;\;\;\frac{\frac{a}{3.129999999999999893418589635984972119331}}{\left(\sqrt{{\left(\frac{x}{2}\right)}^{2}} + {\left(\frac{y}{2}\right)}^{\left(\frac{2}{2}\right)}\right) \cdot \left(\sqrt{{\left(\frac{x}{2}\right)}^{2}} - {\left(\frac{y}{2}\right)}^{\left(\frac{2}{2}\right)}\right)} \cdot \left(3 \cdot {\left(\frac{z}{2}\right)}^{2} - {\left(\frac{c}{2}\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array}$
\frac{a}{3.129999999999999893418589635984972119331 \cdot \left({\left(\frac{x}{2}\right)}^{2} - {\left(\frac{y}{2}\right)}^{2}\right)} \cdot \left(3 \cdot {\left(\frac{z}{2}\right)}^{2} - {\left(\frac{c}{2}\right)}^{2}\right)
\begin{array}{l}
\mathbf{if}\;{\left(\frac{z}{2}\right)}^{2} \le 6.896059690657343268743834421449770620693 \cdot 10^{290}:\\
\;\;\;\;\frac{\frac{a}{3.129999999999999893418589635984972119331}}{\left(\sqrt{{\left(\frac{x}{2}\right)}^{2}} + {\left(\frac{y}{2}\right)}^{\left(\frac{2}{2}\right)}\right) \cdot \left(\sqrt{{\left(\frac{x}{2}\right)}^{2}} - {\left(\frac{y}{2}\right)}^{\left(\frac{2}{2}\right)}\right)} \cdot \left(3 \cdot {\left(\frac{z}{2}\right)}^{2} - {\left(\frac{c}{2}\right)}^{2}\right)\\

\mathbf{else}:\\
\;\;\;\;0\\

\end{array}
double f(double a, double x, double y, double z, double c) {
double r131592 = a;
double r131593 = 3.13;
double r131594 = x;
double r131595 = 2.0;
double r131596 = r131594 / r131595;
double r131597 = pow(r131596, r131595);
double r131598 = y;
double r131599 = r131598 / r131595;
double r131600 = pow(r131599, r131595);
double r131601 = r131597 - r131600;
double r131602 = r131593 * r131601;
double r131603 = r131592 / r131602;
double r131604 = 3.0;
double r131605 = z;
double r131606 = r131605 / r131595;
double r131607 = pow(r131606, r131595);
double r131608 = r131604 * r131607;
double r131609 = c;
double r131610 = r131609 / r131595;
double r131611 = pow(r131610, r131595);
double r131612 = r131608 - r131611;
double r131613 = r131603 * r131612;
return r131613;
}


double f(double a, double x, double y, double z, double c) {
double r131614 = z;
double r131615 = 2.0;
double r131616 = r131614 / r131615;
double r131617 = pow(r131616, r131615);
double r131618 = 6.896059690657343e+290;
bool r131619 = r131617 <= r131618;
double r131620 = a;
double r131621 = 3.13;
double r131622 = r131620 / r131621;
double r131623 = x;
double r131624 = r131623 / r131615;
double r131625 = pow(r131624, r131615);
double r131626 = sqrt(r131625);
double r131627 = y;
double r131628 = r131627 / r131615;
double r131629 = 2.0;
double r131630 = r131615 / r131629;
double r131631 = pow(r131628, r131630);
double r131632 = r131626 + r131631;
double r131633 = r131626 - r131631;
double r131634 = r131632 * r131633;
double r131635 = r131622 / r131634;
double r131636 = 3.0;
double r131637 = r131636 * r131617;
double r131638 = c;
double r131639 = r131638 / r131615;
double r131640 = pow(r131639, r131615);
double r131641 = r131637 - r131640;
double r131642 = r131635 * r131641;
double r131643 = 0.0;
double r131644 = r131619 ? r131642 : r131643;
return r131644;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Split input into 2 regimes
2. ## if (pow (/ z 2.0) 2.0) < 6.896059690657343e+290

1. Initial program 26.7

$\frac{a}{3.129999999999999893418589635984972119331 \cdot \left({\left(\frac{x}{2}\right)}^{2} - {\left(\frac{y}{2}\right)}^{2}\right)} \cdot \left(3 \cdot {\left(\frac{z}{2}\right)}^{2} - {\left(\frac{c}{2}\right)}^{2}\right)$
2. Using strategy rm
3. Applied sqr-pow26.7

$\leadsto \frac{a}{3.129999999999999893418589635984972119331 \cdot \left({\left(\frac{x}{2}\right)}^{2} - \color{blue}{{\left(\frac{y}{2}\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(\frac{y}{2}\right)}^{\left(\frac{2}{2}\right)}}\right)} \cdot \left(3 \cdot {\left(\frac{z}{2}\right)}^{2} - {\left(\frac{c}{2}\right)}^{2}\right)$

$\leadsto \frac{a}{3.129999999999999893418589635984972119331 \cdot \left(\color{blue}{\sqrt{{\left(\frac{x}{2}\right)}^{2}} \cdot \sqrt{{\left(\frac{x}{2}\right)}^{2}}} - {\left(\frac{y}{2}\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(\frac{y}{2}\right)}^{\left(\frac{2}{2}\right)}\right)} \cdot \left(3 \cdot {\left(\frac{z}{2}\right)}^{2} - {\left(\frac{c}{2}\right)}^{2}\right)$
5. Applied difference-of-squares23.9

$\leadsto \frac{a}{3.129999999999999893418589635984972119331 \cdot \color{blue}{\left(\left(\sqrt{{\left(\frac{x}{2}\right)}^{2}} + {\left(\frac{y}{2}\right)}^{\left(\frac{2}{2}\right)}\right) \cdot \left(\sqrt{{\left(\frac{x}{2}\right)}^{2}} - {\left(\frac{y}{2}\right)}^{\left(\frac{2}{2}\right)}\right)\right)}} \cdot \left(3 \cdot {\left(\frac{z}{2}\right)}^{2} - {\left(\frac{c}{2}\right)}^{2}\right)$
6. Using strategy rm
7. Applied associate-/r*23.9

$\leadsto \color{blue}{\frac{\frac{a}{3.129999999999999893418589635984972119331}}{\left(\sqrt{{\left(\frac{x}{2}\right)}^{2}} + {\left(\frac{y}{2}\right)}^{\left(\frac{2}{2}\right)}\right) \cdot \left(\sqrt{{\left(\frac{x}{2}\right)}^{2}} - {\left(\frac{y}{2}\right)}^{\left(\frac{2}{2}\right)}\right)}} \cdot \left(3 \cdot {\left(\frac{z}{2}\right)}^{2} - {\left(\frac{c}{2}\right)}^{2}\right)$

## if 6.896059690657343e+290 < (pow (/ z 2.0) 2.0)

1. Initial program 62.4

$\frac{a}{3.129999999999999893418589635984972119331 \cdot \left({\left(\frac{x}{2}\right)}^{2} - {\left(\frac{y}{2}\right)}^{2}\right)} \cdot \left(3 \cdot {\left(\frac{z}{2}\right)}^{2} - {\left(\frac{c}{2}\right)}^{2}\right)$
2. Taylor expanded around 0 57.8

$\leadsto \color{blue}{0}$
3. Recombined 2 regimes into one program.
4. Final simplification30.8

$\leadsto \begin{array}{l} \mathbf{if}\;{\left(\frac{z}{2}\right)}^{2} \le 6.896059690657343268743834421449770620693 \cdot 10^{290}:\\ \;\;\;\;\frac{\frac{a}{3.129999999999999893418589635984972119331}}{\left(\sqrt{{\left(\frac{x}{2}\right)}^{2}} + {\left(\frac{y}{2}\right)}^{\left(\frac{2}{2}\right)}\right) \cdot \left(\sqrt{{\left(\frac{x}{2}\right)}^{2}} - {\left(\frac{y}{2}\right)}^{\left(\frac{2}{2}\right)}\right)} \cdot \left(3 \cdot {\left(\frac{z}{2}\right)}^{2} - {\left(\frac{c}{2}\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array}$

# Reproduce

herbie shell --seed 1
(FPCore (a x y z c)
:name "(a / (3.13 * ( pow (x / 2, 2) - pow(y / 2, 2)))) * (3 * pow(z / 2, 2) - pow(c / 2, 2))"
:precision binary64
(* (/ a (* 3.1299999999999999 (- (pow (/ x 2) 2) (pow (/ y 2) 2)))) (- (* 3 (pow (/ z 2) 2)) (pow (/ c 2) 2))))