Average Error: 6.5 → 1.8
Time: 20.5s
Precision: 64
Internal precision: 128
\[x + \frac{\left(y - x\right) \cdot z}{t}\]
\[\frac{y - x}{\frac{t}{z}} + x\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original6.5
Comparison1.9
Herbie1.8
\[ \begin{array}{l} \mathbf{if}\;x \lt -9.025511195533005 \cdot 10^{-135}:\\ \;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\ \mathbf{if}\;x \lt 4.275032163700715 \cdot 10^{-250}:\\ \;\;\;\;x + \frac{y - x}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \end{array} \]

Derivation

  1. Initial program 6.5

    \[x + \frac{\left(y - x\right) \cdot z}{t}\]
  2. Applied taylor 6.5

    \[\leadsto x + \left(\frac{z \cdot y}{t} - \frac{z \cdot x}{t}\right)\]
  3. Taylor expanded around 0 6.5

    \[\leadsto x + \color{blue}{\left(\frac{z \cdot y}{t} - \frac{z \cdot x}{t}\right)}\]
  4. Applied simplify 1.8

    \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}} + x}\]
  5. Removed slow pow expressions

Runtime

Time bar (total: 20.5s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(1654686620 2438982216 3876014286 3286513149 4100816977 2464544364)'
(FPCore (x y z t)
  :name "Numeric.Histogram:binBounds from Chart-1.5.3"

  :target
  (if (< x -9.025511195533005e-135) (- x (* (/ z t) (- x y))) (if (< x 4.275032163700715e-250) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z)))))

  (+ x (/ (* (- y x) z) t)))