Average Error: 17.9 → 0.0
Time: 30.8s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[y \cdot \left(x - z\right)\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
y \cdot \left(x - z\right)
double f(double x, double y, double z) {
        double r670147 = x;
        double r670148 = y;
        double r670149 = r670147 * r670148;
        double r670150 = z;
        double r670151 = r670148 * r670150;
        double r670152 = r670149 - r670151;
        double r670153 = r670148 * r670148;
        double r670154 = r670152 - r670153;
        double r670155 = r670154 + r670153;
        return r670155;
}

double f(double x, double y, double z) {
        double r670156 = y;
        double r670157 = x;
        double r670158 = z;
        double r670159 = r670157 - r670158;
        double r670160 = r670156 * r670159;
        return r670160;
}

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

Original17.9
Target0.0
Herbie0.0
\[\left(x - z\right) \cdot y\]

Derivation

  1. Initial program 17.9

    \[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
  2. Simplified0.0

    \[\leadsto \color{blue}{y \cdot \left(x - z\right)}\]
  3. Final simplification0.0

    \[\leadsto y \cdot \left(x - z\right)\]

Reproduce

herbie shell --seed 2020043 +o rules:numerics
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, B"
  :precision binary64

  :herbie-target
  (* (- x z) y)

  (+ (- (- (* x y) (* y z)) (* y y)) (* y y)))