Average Error: 18.0 → 0.0
Time: 15.6s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[\left(-z\right) \cdot y + y \cdot x\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
\left(-z\right) \cdot y + y \cdot x
double f(double x, double y, double z) {
        double r17494297 = x;
        double r17494298 = y;
        double r17494299 = r17494297 * r17494298;
        double r17494300 = z;
        double r17494301 = r17494298 * r17494300;
        double r17494302 = r17494299 - r17494301;
        double r17494303 = r17494298 * r17494298;
        double r17494304 = r17494302 - r17494303;
        double r17494305 = r17494304 + r17494303;
        return r17494305;
}

double f(double x, double y, double z) {
        double r17494306 = z;
        double r17494307 = -r17494306;
        double r17494308 = y;
        double r17494309 = r17494307 * r17494308;
        double r17494310 = x;
        double r17494311 = r17494308 * r17494310;
        double r17494312 = r17494309 + r17494311;
        return r17494312;
}

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

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

Derivation

  1. Initial program 18.0

    \[\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. Using strategy rm
  4. Applied sub-neg0.0

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

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

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

Reproduce

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

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

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