Average Error: 2.0 → 0.2
Time: 5.4s
Precision: 64
\[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\]
\[x - \frac{y - z}{\left(t - z\right) + 1} \cdot a\]
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
x - \frac{y - z}{\left(t - z\right) + 1} \cdot a
double f(double x, double y, double z, double t, double a) {
        double r683647 = x;
        double r683648 = y;
        double r683649 = z;
        double r683650 = r683648 - r683649;
        double r683651 = t;
        double r683652 = r683651 - r683649;
        double r683653 = 1.0;
        double r683654 = r683652 + r683653;
        double r683655 = a;
        double r683656 = r683654 / r683655;
        double r683657 = r683650 / r683656;
        double r683658 = r683647 - r683657;
        return r683658;
}

double f(double x, double y, double z, double t, double a) {
        double r683659 = x;
        double r683660 = y;
        double r683661 = z;
        double r683662 = r683660 - r683661;
        double r683663 = t;
        double r683664 = r683663 - r683661;
        double r683665 = 1.0;
        double r683666 = r683664 + r683665;
        double r683667 = r683662 / r683666;
        double r683668 = a;
        double r683669 = r683667 * r683668;
        double r683670 = r683659 - r683669;
        return r683670;
}

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

Original2.0
Target0.2
Herbie0.2
\[x - \frac{y - z}{\left(t - z\right) + 1} \cdot a\]

Derivation

  1. Initial program 2.0

    \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\]
  2. Using strategy rm
  3. Applied associate-/r/0.2

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

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

Reproduce

herbie shell --seed 2020001 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
  :precision binary64

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

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