Average Error: 10.8 → 1.2
Time: 4.8s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[x + \frac{z - t}{a - t} \cdot y\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
x + \frac{z - t}{a - t} \cdot y
double f(double x, double y, double z, double t, double a) {
        double r454726 = x;
        double r454727 = y;
        double r454728 = z;
        double r454729 = t;
        double r454730 = r454728 - r454729;
        double r454731 = r454727 * r454730;
        double r454732 = a;
        double r454733 = r454732 - r454729;
        double r454734 = r454731 / r454733;
        double r454735 = r454726 + r454734;
        return r454735;
}

double f(double x, double y, double z, double t, double a) {
        double r454736 = x;
        double r454737 = z;
        double r454738 = t;
        double r454739 = r454737 - r454738;
        double r454740 = a;
        double r454741 = r454740 - r454738;
        double r454742 = r454739 / r454741;
        double r454743 = y;
        double r454744 = r454742 * r454743;
        double r454745 = r454736 + r454744;
        return r454745;
}

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

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

Derivation

  1. Initial program 10.8

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

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

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

    \[\leadsto x + \frac{1}{\color{blue}{\frac{a - t}{z - t} \cdot \frac{1}{y}}}\]
  8. Applied add-sqr-sqrt1.1

    \[\leadsto x + \frac{\color{blue}{\sqrt{1} \cdot \sqrt{1}}}{\frac{a - t}{z - t} \cdot \frac{1}{y}}\]
  9. Applied times-frac1.3

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

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

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

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

Reproduce

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

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

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