Average Error: 21.7 → 0.1
Time: 16.5s
Precision: 64
$\frac{\left(42 \cdot \left(x - 17\right)\right) \cdot {x}^{2}}{\sin x}$
$\begin{array}{l} \mathbf{if}\;x \le -1.934438736750215611791443859335259958243 \cdot 10^{-5}:\\ \;\;\;\;\frac{42 \cdot {x}^{3} - 714 \cdot {x}^{2}}{\sin x}\\ \mathbf{elif}\;x \le 1.330993946290874217685517287251602446318 \cdot 10^{-92}:\\ \;\;\;\;42 \cdot {x}^{2} - \left(714 \cdot x + 118.9999999999999857891452847979962825775 \cdot {x}^{3}\right)\\ \mathbf{else}:\\ \;\;\;\;42 \cdot \frac{{x}^{3}}{\sin x} - 714 \cdot \frac{{x}^{2}}{\sin x}\\ \end{array}$
\frac{\left(42 \cdot \left(x - 17\right)\right) \cdot {x}^{2}}{\sin x}
\begin{array}{l}
\mathbf{if}\;x \le -1.934438736750215611791443859335259958243 \cdot 10^{-5}:\\
\;\;\;\;\frac{42 \cdot {x}^{3} - 714 \cdot {x}^{2}}{\sin x}\\

\mathbf{elif}\;x \le 1.330993946290874217685517287251602446318 \cdot 10^{-92}:\\
\;\;\;\;42 \cdot {x}^{2} - \left(714 \cdot x + 118.9999999999999857891452847979962825775 \cdot {x}^{3}\right)\\

\mathbf{else}:\\
\;\;\;\;42 \cdot \frac{{x}^{3}}{\sin x} - 714 \cdot \frac{{x}^{2}}{\sin x}\\

\end{array}
double f(double x) {
double r1927127 = 42.0;
double r1927128 = x;
double r1927129 = 17.0;
double r1927130 = r1927128 - r1927129;
double r1927131 = r1927127 * r1927130;
double r1927132 = 2.0;
double r1927133 = pow(r1927128, r1927132);
double r1927134 = r1927131 * r1927133;
double r1927135 = sin(r1927128);
double r1927136 = r1927134 / r1927135;
return r1927136;
}


double f(double x) {
double r1927137 = x;
double r1927138 = -1.9344387367502156e-05;
bool r1927139 = r1927137 <= r1927138;
double r1927140 = 42.0;
double r1927141 = 3.0;
double r1927142 = pow(r1927137, r1927141);
double r1927143 = r1927140 * r1927142;
double r1927144 = 714.0;
double r1927145 = 2.0;
double r1927146 = pow(r1927137, r1927145);
double r1927147 = r1927144 * r1927146;
double r1927148 = r1927143 - r1927147;
double r1927149 = sin(r1927137);
double r1927150 = r1927148 / r1927149;
double r1927151 = 1.3309939462908742e-92;
bool r1927152 = r1927137 <= r1927151;
double r1927153 = r1927140 * r1927146;
double r1927154 = r1927144 * r1927137;
double r1927155 = 118.99999999999999;
double r1927156 = r1927155 * r1927142;
double r1927157 = r1927154 + r1927156;
double r1927158 = r1927153 - r1927157;
double r1927159 = r1927142 / r1927149;
double r1927160 = r1927140 * r1927159;
double r1927161 = r1927146 / r1927149;
double r1927162 = r1927144 * r1927161;
double r1927163 = r1927160 - r1927162;
double r1927164 = r1927152 ? r1927158 : r1927163;
double r1927165 = r1927139 ? r1927150 : r1927164;
return r1927165;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Split input into 3 regimes
2. ## if x < -1.9344387367502156e-05

1. Initial program 0.5

$\frac{\left(42 \cdot \left(x - 17\right)\right) \cdot {x}^{2}}{\sin x}$
2. Taylor expanded around 0 0.4

$\leadsto \frac{\color{blue}{42 \cdot {x}^{3} - 714 \cdot {x}^{2}}}{\sin x}$

## if -1.9344387367502156e-05 < x < 1.3309939462908742e-92

1. Initial program 34.2

$\frac{\left(42 \cdot \left(x - 17\right)\right) \cdot {x}^{2}}{\sin x}$
2. Taylor expanded around 0 0.0

$\leadsto \color{blue}{42 \cdot {x}^{2} - \left(714 \cdot x + 118.9999999999999857891452847979962825775 \cdot {x}^{3}\right)}$

## if 1.3309939462908742e-92 < x

1. Initial program 0.4

$\frac{\left(42 \cdot \left(x - 17\right)\right) \cdot {x}^{2}}{\sin x}$
2. Taylor expanded around inf 0.3

$\leadsto \color{blue}{42 \cdot \frac{{x}^{3}}{\sin x} - 714 \cdot \frac{{x}^{2}}{\sin x}}$
3. Recombined 3 regimes into one program.
4. Final simplification0.1

$\leadsto \begin{array}{l} \mathbf{if}\;x \le -1.934438736750215611791443859335259958243 \cdot 10^{-5}:\\ \;\;\;\;\frac{42 \cdot {x}^{3} - 714 \cdot {x}^{2}}{\sin x}\\ \mathbf{elif}\;x \le 1.330993946290874217685517287251602446318 \cdot 10^{-92}:\\ \;\;\;\;42 \cdot {x}^{2} - \left(714 \cdot x + 118.9999999999999857891452847979962825775 \cdot {x}^{3}\right)\\ \mathbf{else}:\\ \;\;\;\;42 \cdot \frac{{x}^{3}}{\sin x} - 714 \cdot \frac{{x}^{2}}{\sin x}\\ \end{array}$

# Reproduce

herbie shell --seed 1
(FPCore (x)
:name "42 * (x- 17) * x^2 / sin(x)"
:precision binary64
(/ (* (* 42 (- x 17)) (pow x 2)) (sin x)))