Average Error: 12.4 → 0.0
Time: 10.1s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[y \cdot x - z \cdot y\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
y \cdot x - z \cdot y
double f(double x, double y, double z) {
        double r20925269 = x;
        double r20925270 = y;
        double r20925271 = r20925269 * r20925270;
        double r20925272 = r20925270 * r20925270;
        double r20925273 = r20925271 - r20925272;
        double r20925274 = r20925273 + r20925272;
        double r20925275 = z;
        double r20925276 = r20925270 * r20925275;
        double r20925277 = r20925274 - r20925276;
        return r20925277;
}

double f(double x, double y, double z) {
        double r20925278 = y;
        double r20925279 = x;
        double r20925280 = r20925278 * r20925279;
        double r20925281 = z;
        double r20925282 = r20925281 * r20925278;
        double r20925283 = r20925280 - r20925282;
        return r20925283;
}

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

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

Derivation

  1. Initial program 12.4

    \[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
  2. Using strategy rm
  3. Applied distribute-rgt-out--12.4

    \[\leadsto \left(\color{blue}{y \cdot \left(x - y\right)} + y \cdot y\right) - y \cdot z\]
  4. Applied distribute-lft-out8.5

    \[\leadsto \color{blue}{y \cdot \left(\left(x - y\right) + y\right)} - y \cdot z\]
  5. Simplified0.0

    \[\leadsto y \cdot \color{blue}{x} - y \cdot z\]
  6. Final simplification0.0

    \[\leadsto y \cdot x - z \cdot y\]

Reproduce

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

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

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