Average Error: 1.3 → 1.3
Time: 23.0s
Precision: 64
Internal precision: 128
\[x + y \cdot \frac{z - t}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;z \le -9.842217156383647 \cdot 10^{-266}:\\ \;\;\;\;x + y \cdot \frac{z - t}{z - a}\\ \mathbf{if}\;z \le 3.0781687692976224 \cdot 10^{-179}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{z - a}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Target

Original1.3
Comparison1.2
Herbie1.3
\[ x + \frac{y}{\frac{z - a}{z - t}} \]

Derivation

  1. Split input into 2 regimes.
  2. if z < -9.842217156383647e-266 or 3.0781687692976224e-179 < z

    1. Initial program 0.9

      \[x + y \cdot \frac{z - t}{z - a}\]

    if -9.842217156383647e-266 < z < 3.0781687692976224e-179

    1. Initial program 3.6

      \[x + y \cdot \frac{z - t}{z - a}\]
    2. Using strategy rm
    3. Applied div-inv 3.6

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

      \[\leadsto x + \color{blue}{\left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{z - a}}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 23.0s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(1574844451 2488967030 227595007 1905175681 3703066099 2351256768)'
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"

  :target
  (+ x (/ y (/ (- z a) (- z t))))

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