Average Error: 2.2 → 0.3
Time: 9.5s
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 r795675 = x;
        double r795676 = y;
        double r795677 = z;
        double r795678 = r795676 - r795677;
        double r795679 = t;
        double r795680 = r795679 - r795677;
        double r795681 = 1.0;
        double r795682 = r795680 + r795681;
        double r795683 = a;
        double r795684 = r795682 / r795683;
        double r795685 = r795678 / r795684;
        double r795686 = r795675 - r795685;
        return r795686;
}

double f(double x, double y, double z, double t, double a) {
        double r795687 = x;
        double r795688 = y;
        double r795689 = z;
        double r795690 = r795688 - r795689;
        double r795691 = t;
        double r795692 = r795691 - r795689;
        double r795693 = 1.0;
        double r795694 = r795692 + r795693;
        double r795695 = r795690 / r795694;
        double r795696 = a;
        double r795697 = r795695 * r795696;
        double r795698 = r795687 - r795697;
        return r795698;
}

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.2
Target0.3
Herbie0.3
\[x - \frac{y - z}{\left(t - z\right) + 1} \cdot a\]

Derivation

  1. Initial program 2.2

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

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

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

Reproduce

herbie shell --seed 2020046 
(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))))