Average Error: 1.5 → 2.8
Time: 5.0s
Precision: 64
\[x + y \cdot \frac{z - t}{z - a}\]
\[x + \left(z - t\right) \cdot \frac{y}{z - a}\]
x + y \cdot \frac{z - t}{z - a}
x + \left(z - t\right) \cdot \frac{y}{z - a}
double f(double x, double y, double z, double t, double a) {
        double r350590 = x;
        double r350591 = y;
        double r350592 = z;
        double r350593 = t;
        double r350594 = r350592 - r350593;
        double r350595 = a;
        double r350596 = r350592 - r350595;
        double r350597 = r350594 / r350596;
        double r350598 = r350591 * r350597;
        double r350599 = r350590 + r350598;
        return r350599;
}

double f(double x, double y, double z, double t, double a) {
        double r350600 = x;
        double r350601 = z;
        double r350602 = t;
        double r350603 = r350601 - r350602;
        double r350604 = y;
        double r350605 = a;
        double r350606 = r350601 - r350605;
        double r350607 = r350604 / r350606;
        double r350608 = r350603 * r350607;
        double r350609 = r350600 + r350608;
        return r350609;
}

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.5
Target1.3
Herbie2.8
\[x + \frac{y}{\frac{z - a}{z - t}}\]

Derivation

  1. Split input into 3 regimes
  2. if y < -158224265619362.66

    1. Initial program 0.5

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

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

    if -158224265619362.66 < y < 1.9196722393854428e-44

    1. Initial program 2.4

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

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

      \[\leadsto x + y \cdot \color{blue}{\frac{z - t}{z - a}}\]
    6. Applied associate-*r/0.4

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

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

    if 1.9196722393854428e-44 < y

    1. Initial program 0.5

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

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

      \[\leadsto x + y \cdot \color{blue}{\frac{z - t}{z - a}}\]
    6. Applied associate-*r/19.1

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

      \[\leadsto x + \frac{\color{blue}{\left(z - t\right) \cdot y}}{z - a}\]
    8. Using strategy rm
    9. Applied *-un-lft-identity19.1

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

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

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

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

Reproduce

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

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

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