Average Error: 0.1 → 0.1
Time: 7.6s
Precision: 64
\[\frac{4 \cdot \left(\left(x - y\right) - z \cdot 0.5\right)}{z}\]
\[\frac{4 \cdot \left(\left(x - y\right) - z \cdot 0.5\right)}{z}\]
\frac{4 \cdot \left(\left(x - y\right) - z \cdot 0.5\right)}{z}
\frac{4 \cdot \left(\left(x - y\right) - z \cdot 0.5\right)}{z}
double f(double x, double y, double z) {
        double r840584 = 4.0;
        double r840585 = x;
        double r840586 = y;
        double r840587 = r840585 - r840586;
        double r840588 = z;
        double r840589 = 0.5;
        double r840590 = r840588 * r840589;
        double r840591 = r840587 - r840590;
        double r840592 = r840584 * r840591;
        double r840593 = r840592 / r840588;
        return r840593;
}

double f(double x, double y, double z) {
        double r840594 = 4.0;
        double r840595 = x;
        double r840596 = y;
        double r840597 = r840595 - r840596;
        double r840598 = z;
        double r840599 = 0.5;
        double r840600 = r840598 * r840599;
        double r840601 = r840597 - r840600;
        double r840602 = r840594 * r840601;
        double r840603 = r840602 / r840598;
        return r840603;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 0.1

    \[\frac{4 \cdot \left(\left(x - y\right) - z \cdot 0.5\right)}{z}\]
  2. Final simplification0.1

    \[\leadsto \frac{4 \cdot \left(\left(x - y\right) - z \cdot 0.5\right)}{z}\]

Reproduce

herbie shell --seed 2020045 
(FPCore (x y z)
  :name "Data.Array.Repa.Algorithms.ColorRamp:rampColorHotToCold from repa-algorithms-3.4.0.1, B"
  :precision binary64

  :herbie-target
  (- (* 4 (/ x z)) (+ 2 (* 4 (/ y z))))

  (/ (* 4 (- (- x y) (* z 0.5))) z))