Average Error: 2.0 → 0.3
Time: 14.1s
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 r356157 = x;
        double r356158 = y;
        double r356159 = z;
        double r356160 = r356158 - r356159;
        double r356161 = t;
        double r356162 = r356161 - r356159;
        double r356163 = 1.0;
        double r356164 = r356162 + r356163;
        double r356165 = a;
        double r356166 = r356164 / r356165;
        double r356167 = r356160 / r356166;
        double r356168 = r356157 - r356167;
        return r356168;
}

double f(double x, double y, double z, double t, double a) {
        double r356169 = x;
        double r356170 = y;
        double r356171 = z;
        double r356172 = r356170 - r356171;
        double r356173 = t;
        double r356174 = r356173 - r356171;
        double r356175 = 1.0;
        double r356176 = r356174 + r356175;
        double r356177 = r356172 / r356176;
        double r356178 = a;
        double r356179 = r356177 * r356178;
        double r356180 = r356169 - r356179;
        return r356180;
}

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.3
Herbie0.3
\[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.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 2019323 
(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))))