Average Error: 16.3 → 4.7
Time: 20.3s
Precision: 64
$\left(\left(ce \cdot zr\right) \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right) \cdot \left(rcp_dr \cdot rcp_dr\right) + cphi_over_D$
$\begin{array}{l} \mathbf{if}\;ce \cdot zr = -\infty:\\ \;\;\;\;ce \cdot \left(zr \cdot \left(rcp_dr \cdot \left(rcp_dr \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right)\right)\right) + cphi_over_D\\ \mathbf{elif}\;ce \cdot zr \le -1.749505972391894322265286434371673614155 \cdot 10^{-87}:\\ \;\;\;\;\left(ce \cdot zr\right) \cdot \left(rcp_dr \cdot \left(rcp_dr \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right)\right) + cphi_over_D\\ \mathbf{elif}\;ce \cdot zr \le -0.0:\\ \;\;\;\;\left(\left(\left(ce \cdot zr\right) \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right) \cdot rcp_dr\right) \cdot rcp_dr + cphi_over_D\\ \mathbf{elif}\;ce \cdot zr \le 7.922878813897179396057648561958113007386 \cdot 10^{291}:\\ \;\;\;\;\left(\left(ce \cdot zr\right) \cdot rcp_dr\right) \cdot \left(rcp_dr \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right) + cphi_over_D\\ \mathbf{else}:\\ \;\;\;\;ce \cdot \left(zr \cdot \left(rcp_dr \cdot \left(rcp_dr \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right)\right)\right) + cphi_over_D\\ \end{array}$
\left(\left(ce \cdot zr\right) \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right) \cdot \left(rcp_dr \cdot rcp_dr\right) + cphi_over_D
\begin{array}{l}
\mathbf{if}\;ce \cdot zr = -\infty:\\
\;\;\;\;ce \cdot \left(zr \cdot \left(rcp_dr \cdot \left(rcp_dr \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right)\right)\right) + cphi_over_D\\

\mathbf{elif}\;ce \cdot zr \le -1.749505972391894322265286434371673614155 \cdot 10^{-87}:\\
\;\;\;\;\left(ce \cdot zr\right) \cdot \left(rcp_dr \cdot \left(rcp_dr \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right)\right) + cphi_over_D\\

\mathbf{elif}\;ce \cdot zr \le -0.0:\\
\;\;\;\;\left(\left(\left(ce \cdot zr\right) \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right) \cdot rcp_dr\right) \cdot rcp_dr + cphi_over_D\\

\mathbf{elif}\;ce \cdot zr \le 7.922878813897179396057648561958113007386 \cdot 10^{291}:\\
\;\;\;\;\left(\left(ce \cdot zr\right) \cdot rcp_dr\right) \cdot \left(rcp_dr \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right) + cphi_over_D\\

\mathbf{else}:\\
\;\;\;\;ce \cdot \left(zr \cdot \left(rcp_dr \cdot \left(rcp_dr \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right)\right)\right) + cphi_over_D\\

\end{array}
double f(double ce, double zr, double sigma_tr_dr, double f, double rcp_dr, double cphi_over_D) {
double r1773959 = ce;
double r1773960 = zr;
double r1773961 = r1773959 * r1773960;
double r1773962 = sigma_tr_dr;
double r1773963 = 1.0;
double r1773964 = f;
double r1773965 = r1773963 * r1773964;
double r1773966 = r1773962 + r1773965;
double r1773967 = r1773961 * r1773966;
double r1773968 = rcp_dr;
double r1773969 = r1773968 * r1773968;
double r1773970 = r1773967 * r1773969;
double r1773971 = cphi_over_D;
double r1773972 = r1773970 + r1773971;
return r1773972;
}


double f(double ce, double zr, double sigma_tr_dr, double f, double rcp_dr, double cphi_over_D) {
double r1773973 = ce;
double r1773974 = zr;
double r1773975 = r1773973 * r1773974;
double r1773976 = -inf.0;
bool r1773977 = r1773975 <= r1773976;
double r1773978 = rcp_dr;
double r1773979 = sigma_tr_dr;
double r1773980 = 1.0;
double r1773981 = f;
double r1773982 = r1773980 * r1773981;
double r1773983 = r1773979 + r1773982;
double r1773984 = r1773978 * r1773983;
double r1773985 = r1773978 * r1773984;
double r1773986 = r1773974 * r1773985;
double r1773987 = r1773973 * r1773986;
double r1773988 = cphi_over_D;
double r1773989 = r1773987 + r1773988;
double r1773990 = -1.7495059723918943e-87;
bool r1773991 = r1773975 <= r1773990;
double r1773992 = r1773975 * r1773985;
double r1773993 = r1773992 + r1773988;
double r1773994 = -0.0;
bool r1773995 = r1773975 <= r1773994;
double r1773996 = r1773975 * r1773983;
double r1773997 = r1773996 * r1773978;
double r1773998 = r1773997 * r1773978;
double r1773999 = r1773998 + r1773988;
double r1774000 = 7.922878813897179e+291;
bool r1774001 = r1773975 <= r1774000;
double r1774002 = r1773975 * r1773978;
double r1774003 = r1774002 * r1773984;
double r1774004 = r1774003 + r1773988;
double r1774005 = r1774001 ? r1774004 : r1773989;
double r1774006 = r1773995 ? r1773999 : r1774005;
double r1774007 = r1773991 ? r1773993 : r1774006;
double r1774008 = r1773977 ? r1773989 : r1774007;
return r1774008;
}



# Try it out

Your Program's Arguments

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Split input into 4 regimes
2. ## if (* ce zr) < -inf.0 or 7.922878813897179e+291 < (* ce zr)

1. Initial program 62.9

$\left(\left(ce \cdot zr\right) \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right) \cdot \left(rcp_dr \cdot rcp_dr\right) + cphi_over_D$
2. Using strategy rm
3. Applied associate-*l*61.5

$\leadsto \color{blue}{\left(ce \cdot zr\right) \cdot \left(\left(sigma_tr_dr + 1 \cdot f\right) \cdot \left(rcp_dr \cdot rcp_dr\right)\right)} + cphi_over_D$
4. Simplified60.8

$\leadsto \left(ce \cdot zr\right) \cdot \color{blue}{\left(rcp_dr \cdot \left(rcp_dr \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right)\right)} + cphi_over_D$
5. Using strategy rm
6. Applied associate-*l*13.5

$\leadsto \color{blue}{ce \cdot \left(zr \cdot \left(rcp_dr \cdot \left(rcp_dr \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right)\right)\right)} + cphi_over_D$

## if -inf.0 < (* ce zr) < -1.7495059723918943e-87

1. Initial program 14.9

$\left(\left(ce \cdot zr\right) \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right) \cdot \left(rcp_dr \cdot rcp_dr\right) + cphi_over_D$
2. Using strategy rm
3. Applied associate-*l*7.1

$\leadsto \color{blue}{\left(ce \cdot zr\right) \cdot \left(\left(sigma_tr_dr + 1 \cdot f\right) \cdot \left(rcp_dr \cdot rcp_dr\right)\right)} + cphi_over_D$
4. Simplified2.3

$\leadsto \left(ce \cdot zr\right) \cdot \color{blue}{\left(rcp_dr \cdot \left(rcp_dr \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right)\right)} + cphi_over_D$

## if -1.7495059723918943e-87 < (* ce zr) < -0.0

1. Initial program 10.3

$\left(\left(ce \cdot zr\right) \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right) \cdot \left(rcp_dr \cdot rcp_dr\right) + cphi_over_D$
2. Using strategy rm
3. Applied associate-*r*5.3

$\leadsto \color{blue}{\left(\left(\left(ce \cdot zr\right) \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right) \cdot rcp_dr\right) \cdot rcp_dr} + cphi_over_D$

## if -0.0 < (* ce zr) < 7.922878813897179e+291

1. Initial program 13.4

$\left(\left(ce \cdot zr\right) \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right) \cdot \left(rcp_dr \cdot rcp_dr\right) + cphi_over_D$
2. Using strategy rm
3. Applied associate-*l*11.8

$\leadsto \color{blue}{\left(ce \cdot zr\right) \cdot \left(\left(sigma_tr_dr + 1 \cdot f\right) \cdot \left(rcp_dr \cdot rcp_dr\right)\right)} + cphi_over_D$
4. Simplified8.9

$\leadsto \left(ce \cdot zr\right) \cdot \color{blue}{\left(rcp_dr \cdot \left(rcp_dr \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right)\right)} + cphi_over_D$
5. Using strategy rm
6. Applied associate-*r*4.9

$\leadsto \color{blue}{\left(\left(ce \cdot zr\right) \cdot rcp_dr\right) \cdot \left(rcp_dr \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right)} + cphi_over_D$
3. Recombined 4 regimes into one program.
4. Final simplification4.7

$\leadsto \begin{array}{l} \mathbf{if}\;ce \cdot zr = -\infty:\\ \;\;\;\;ce \cdot \left(zr \cdot \left(rcp_dr \cdot \left(rcp_dr \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right)\right)\right) + cphi_over_D\\ \mathbf{elif}\;ce \cdot zr \le -1.749505972391894322265286434371673614155 \cdot 10^{-87}:\\ \;\;\;\;\left(ce \cdot zr\right) \cdot \left(rcp_dr \cdot \left(rcp_dr \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right)\right) + cphi_over_D\\ \mathbf{elif}\;ce \cdot zr \le -0.0:\\ \;\;\;\;\left(\left(\left(ce \cdot zr\right) \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right) \cdot rcp_dr\right) \cdot rcp_dr + cphi_over_D\\ \mathbf{elif}\;ce \cdot zr \le 7.922878813897179396057648561958113007386 \cdot 10^{291}:\\ \;\;\;\;\left(\left(ce \cdot zr\right) \cdot rcp_dr\right) \cdot \left(rcp_dr \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right) + cphi_over_D\\ \mathbf{else}:\\ \;\;\;\;ce \cdot \left(zr \cdot \left(rcp_dr \cdot \left(rcp_dr \cdot \left(sigma_tr_dr + 1 \cdot f\right)\right)\right)\right) + cphi_over_D\\ \end{array}$

# Reproduce

herbie shell --seed 1
(FPCore (ce zr sigma_tr_dr f rcp_dr cphi_over_D)
:name "ce * zr * (sigma_tr_dr + 1.0f) * (rcp_dr*rcp_dr) + cphi_over_D"
:precision binary64
(+ (* (* (* ce zr) (+ sigma_tr_dr (* 1 f))) (* rcp_dr rcp_dr)) cphi_over_D))