Average Error: 17.0 → 0.0
Time: 15.0s
Precision: 64
\[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y\]
\[y \cdot x + y \cdot \left(-z\right)\]
\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y
y \cdot x + y \cdot \left(-z\right)
double f(double x, double y, double z) {
        double r314128 = x;
        double r314129 = y;
        double r314130 = r314128 * r314129;
        double r314131 = r314129 * r314129;
        double r314132 = r314130 + r314131;
        double r314133 = z;
        double r314134 = r314129 * r314133;
        double r314135 = r314132 - r314134;
        double r314136 = r314135 - r314131;
        return r314136;
}

double f(double x, double y, double z) {
        double r314137 = y;
        double r314138 = x;
        double r314139 = r314137 * r314138;
        double r314140 = z;
        double r314141 = -r314140;
        double r314142 = r314137 * r314141;
        double r314143 = r314139 + r314142;
        return r314143;
}

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.0
Target0.0
Herbie0.0
\[\left(x - z\right) \cdot y\]

Derivation

  1. Initial program 17.0

    \[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\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 y \cdot x + y \cdot \left(-z\right)\]

Reproduce

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

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

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