Average Error: 1.3 → 10.9
Time: 8.7s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
x + y \cdot \frac{z - t}{a - t}
x + \frac{y \cdot \left(z - t\right)}{a - t}
double f(double x, double y, double z, double t, double a) {
        double r416366 = x;
        double r416367 = y;
        double r416368 = z;
        double r416369 = t;
        double r416370 = r416368 - r416369;
        double r416371 = a;
        double r416372 = r416371 - r416369;
        double r416373 = r416370 / r416372;
        double r416374 = r416367 * r416373;
        double r416375 = r416366 + r416374;
        return r416375;
}

double f(double x, double y, double z, double t, double a) {
        double r416376 = x;
        double r416377 = y;
        double r416378 = z;
        double r416379 = t;
        double r416380 = r416378 - r416379;
        double r416381 = r416377 * r416380;
        double r416382 = a;
        double r416383 = r416382 - r416379;
        double r416384 = r416381 / r416383;
        double r416385 = r416376 + r416384;
        return r416385;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original1.3
Target0.5
Herbie10.9
\[\begin{array}{l} \mathbf{if}\;y \lt -8.508084860551241069024247453646278348229 \cdot 10^{-17}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;y \lt 2.894426862792089097262541964056085749132 \cdot 10^{-49}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if y < -0.4573574999993685 or 5.370782751158474e-09 < y

    1. Initial program 0.6

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

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

    if -0.4573574999993685 < y < 5.370782751158474e-09

    1. Initial program 2.0

      \[x + y \cdot \frac{z - t}{a - t}\]
    2. Using strategy rm
    3. Applied associate-*r/0.3

      \[\leadsto x + \color{blue}{\frac{y \cdot \left(z - t\right)}{a - t}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification10.9

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

Reproduce

herbie shell --seed 2019291 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
  :precision binary64

  :herbie-target
  (if (< y -8.50808486055124107e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.8944268627920891e-49) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

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