Average Error: 11.8 → 3.5
Time: 21.0s
Precision: 64
Internal precision: 1408
\[x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(a - x\right)\]
⬇
\[\begin{array}{l}
\mathbf{if}\;z \le -1.63984933815402 \cdot 10^{+178}:\\
\;\;\;\;a - \left(a - x\right) \cdot \frac{y}{z}\\
\mathbf{if}\;z \le 4.4257333746511086 \cdot 10^{+123}:\\
\;\;\;\;x + \left(\left(y - z\right) \cdot \frac{1}{\left(t + 1.0\right) - z}\right) \cdot \left(a - x\right)\\
\mathbf{else}:\\
\;\;\;\;a - \left(a - x\right) \cdot \frac{y}{z}\\
\end{array}\]
Derivation
- Split input into 2 regimes.
-
if z < -1.63984933815402e+178 or 4.4257333746511086e+123 < z
Initial program 30.4
\[x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(a - x\right)\]
Applied taylor 11.3
\[\leadsto \left(\frac{y \cdot x}{z} + a\right) - \frac{y \cdot a}{z}\]
Taylor expanded around inf 11.3
\[\leadsto \color{blue}{\left(\frac{y \cdot x}{z} + a\right) - \frac{y \cdot a}{z}}\]
Applied simplify 1.2
\[\leadsto \color{blue}{a - \left(a - x\right) \cdot \frac{y}{z}}\]
if -1.63984933815402e+178 < z < 4.4257333746511086e+123
Initial program 4.4
\[x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(a - x\right)\]
- Using strategy
rm
Applied div-inv 4.4
\[\leadsto x + \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{\left(t + 1.0\right) - z}\right)} \cdot \left(a - x\right)\]
- Recombined 2 regimes into one program.
- Removed slow pow expressions
Runtime
Please include this information when filing a bug report:
herbie shell --seed '#(1064524629 4159152179 2999149171 575749698 4006532819 692958815)'
(FPCore (x y z t a)
:name "Hakyll.Web.Tags:renderTagCloud from hakyll-4.7.2.3"
(+ x (* (/ (- y z) (- (+ t 1.0) z)) (- a x))))