Average Error: 10.2 → 1.3
Time: 21.9s
Precision: 64
Internal precision: 128
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[t \cdot \left(\left(y - z\right) \cdot \frac{1}{a - z}\right) + x\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Target

Original10.2
Comparison0.5
Herbie1.3
\[ \begin{array}{l} \mathbf{if}\;t \lt -1.0682974490174067 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{if}\;t \lt 3.9110949887586375 \cdot 10^{-141}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \end{array} \]

Derivation

  1. Initial program 10.2

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

    \[\leadsto x + \frac{t \cdot y - t \cdot z}{a - z}\]
  3. Taylor expanded around inf 10.3

    \[\leadsto x + \frac{\color{blue}{t \cdot y - t \cdot z}}{a - z}\]
  4. Applied simplify 2.9

    \[\leadsto \color{blue}{\frac{t}{a - z} \cdot \left(y - z\right) + x}\]
  5. Using strategy rm
  6. Applied div-inv 3.0

    \[\leadsto \color{blue}{\left(t \cdot \frac{1}{a - z}\right)} \cdot \left(y - z\right) + x\]
  7. Applied associate-*l* 1.3

    \[\leadsto \color{blue}{t \cdot \left(\frac{1}{a - z} \cdot \left(y - z\right)\right)} + x\]
  8. Applied simplify 1.2

    \[\leadsto t \cdot \color{blue}{\frac{y - z}{a - z}} + x\]
  9. Using strategy rm
  10. Applied div-inv 1.3

    \[\leadsto t \cdot \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} + x\]
  11. Removed slow pow expressions

Runtime

Time bar (total: 21.9s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(4016366668 4185605309 2846351281 3270746194 1928228605 2862849845)'
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"

  :target
  (if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))

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