Average Error: 2.1 → 1.8
Time: 46.7s
Precision: 64
Internal Precision: 384
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
↓
\[\begin{array}{l}
\mathbf{if}\;x \le -6.906465135771799 \cdot 10^{-107}:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\
\mathbf{if}\;x \le -1.2396732347310702 \cdot 10^{-264}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\
\end{array}\]
Target
| Original | 2.1 |
|---|
| Target | 2.3 |
|---|
| Herbie | 1.8 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\left(y - x\right) \cdot \frac{z}{t} \lt -1013646692435.8867:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\
\mathbf{if}\;\left(y - x\right) \cdot \frac{z}{t} \lt -0.0:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\
\end{array}\]
Derivation
- Split input into 2 regimes
if x < -6.906465135771799e-107 or -1.2396732347310702e-264 < x
Initial program 1.5
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
- Using strategy
rm Applied associate-*r/6.7
\[\leadsto x + \color{blue}{\frac{\left(y - x\right) \cdot z}{t}}\]
- Using strategy
rm Applied associate-/l*1.4
\[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}}\]
if -6.906465135771799e-107 < x < -1.2396732347310702e-264
Initial program 5.5
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
- Using strategy
rm Applied associate-*r/3.8
\[\leadsto x + \color{blue}{\frac{\left(y - x\right) \cdot z}{t}}\]
- Recombined 2 regimes into one program.
- Removed slow
pow expressions.
Runtime
herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit
(FPCore (x y z t)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:tickPosition from plot-0.2.3.4"
:herbie-target
(if (< (* (- y x) (/ z t)) -1013646692435.8867) (+ x (/ (- y x) (/ t z))) (if (< (* (- y x) (/ z t)) -0.0) (+ x (/ (* (- y x) z) t)) (+ x (/ (- y x) (/ t z)))))
(+ x (* (- y x) (/ z t))))