Average Error: 1.2 → 1.2
Time: 5.5s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[x + \frac{1}{\frac{\frac{a - t}{z - t}}{y}}\]
x + y \cdot \frac{z - t}{a - t}
x + \frac{1}{\frac{\frac{a - t}{z - t}}{y}}
double f(double x, double y, double z, double t, double a) {
        double r571490 = x;
        double r571491 = y;
        double r571492 = z;
        double r571493 = t;
        double r571494 = r571492 - r571493;
        double r571495 = a;
        double r571496 = r571495 - r571493;
        double r571497 = r571494 / r571496;
        double r571498 = r571491 * r571497;
        double r571499 = r571490 + r571498;
        return r571499;
}

double f(double x, double y, double z, double t, double a) {
        double r571500 = x;
        double r571501 = 1.0;
        double r571502 = a;
        double r571503 = t;
        double r571504 = r571502 - r571503;
        double r571505 = z;
        double r571506 = r571505 - r571503;
        double r571507 = r571504 / r571506;
        double r571508 = y;
        double r571509 = r571507 / r571508;
        double r571510 = r571501 / r571509;
        double r571511 = r571500 + r571510;
        return r571511;
}

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.2
Target0.5
Herbie1.2
\[\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. Initial program 1.2

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

    \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{a - t}{z - t}}}\]
  4. Using strategy rm
  5. Applied un-div-inv1.1

    \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}}\]
  6. Using strategy rm
  7. Applied clear-num1.2

    \[\leadsto x + \color{blue}{\frac{1}{\frac{\frac{a - t}{z - t}}{y}}}\]
  8. Final simplification1.2

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

Reproduce

herbie shell --seed 2020001 
(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.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

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