Average Error: 10.2 → 1.2
Time: 20.8s
Precision: 64
Internal precision: 128
\[x + \frac{y \cdot \left(z - t\right)}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;z \le -1.7338791390618684 \cdot 10^{-264}:\\ \;\;\;\;x + \frac{y}{1} \cdot \frac{z - t}{z - a}\\ \mathbf{if}\;z \le 6.161869838226869 \cdot 10^{-132}:\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a} + x\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Target

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

Derivation

  1. Split input into 3 regimes.
  2. if z < -1.7338791390618684e-264

    1. Initial program 10.7

      \[x + \frac{y \cdot \left(z - t\right)}{z - a}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity 10.7

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

      \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{z - t}{z - a}}\]

    if -1.7338791390618684e-264 < z < 6.161869838226869e-132

    1. Initial program 3.6

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

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

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

      \[\leadsto \color{blue}{\left(z - t\right) \cdot \frac{y}{z - a} + x}\]

    if 6.161869838226869e-132 < z

    1. Initial program 12.8

      \[x + \frac{y \cdot \left(z - t\right)}{z - a}\]
    2. Using strategy rm
    3. Applied associate-/l* 0.5

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

Runtime

Time bar (total: 20.8s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(38255788 4094469987 1763798563 1987260266 4262192505 2830448021)'
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"

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

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