Average Error: 2.3 → 2.0
Time: 37.2s
Precision: 64
Internal precision: 128
\[\frac{x - y}{z - y} \cdot t\]
⬇
\[\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \cdot t \le -6.607091110953482 \cdot 10^{-14}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{if}\;\frac{x - y}{z - y} \cdot t \le 2.5719851404145336 \cdot 10^{-248}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\
\end{array}\]
Target
| Original | 2.3 |
| Comparison | 2.2 |
| Herbie | 2.0 |
\[ \frac{t}{\frac{z - y}{x - y}} \]
Derivation
- Split input into 3 regimes.
-
if (* (/ (- x y) (- z y)) t) < -6.607091110953482e-14
Initial program 2.8
\[\frac{x - y}{z - y} \cdot t\]
- Using strategy
rm
Applied div-inv 2.9
\[\leadsto \color{blue}{\left(\left(x - y\right) \cdot \frac{1}{z - y}\right)} \cdot t\]
Applied associate-*l* 2.5
\[\leadsto \color{blue}{\left(x - y\right) \cdot \left(\frac{1}{z - y} \cdot t\right)}\]
Applied simplify 2.4
\[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{t}{z - y}}\]
if -6.607091110953482e-14 < (* (/ (- x y) (- z y)) t) < 2.5719851404145336e-248
Initial program 2.7
\[\frac{x - y}{z - y} \cdot t\]
- Using strategy
rm
Applied associate-*l/ 2.3
\[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}}\]
if 2.5719851404145336e-248 < (* (/ (- x y) (- z y)) t)
Initial program 1.6
\[\frac{x - y}{z - y} \cdot t\]
- Recombined 3 regimes into one program.
- Removed slow pow expressions
Runtime
Please include this information when filing a bug report:
herbie --seed '#(1806516843 71397366 2752149017 1663763 1918680773 1427670572)'
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:target
(/ t (/ (- z y) (- x y)))
(* (/ (- x y) (- z y)) t))