Average Error: 12.6 → 0.0
Time: 29.1s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[\frac{\left(x + z\right) \cdot y}{\frac{x + z}{x - z}}\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
\frac{\left(x + z\right) \cdot y}{\frac{x + z}{x - z}}
double f(double x, double y, double z) {
        double r458017 = x;
        double r458018 = y;
        double r458019 = r458017 * r458018;
        double r458020 = r458018 * r458018;
        double r458021 = r458019 - r458020;
        double r458022 = r458021 + r458020;
        double r458023 = z;
        double r458024 = r458018 * r458023;
        double r458025 = r458022 - r458024;
        return r458025;
}

double f(double x, double y, double z) {
        double r458026 = x;
        double r458027 = z;
        double r458028 = r458026 + r458027;
        double r458029 = y;
        double r458030 = r458028 * r458029;
        double r458031 = r458026 - r458027;
        double r458032 = r458028 / r458031;
        double r458033 = r458030 / r458032;
        return r458033;
}

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

Derivation

  1. Initial program 12.6

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

    \[\leadsto \color{blue}{\left(x - z\right) \cdot y}\]
  3. Using strategy rm
  4. Applied flip--24.5

    \[\leadsto \color{blue}{\frac{x \cdot x - z \cdot z}{x + z}} \cdot y\]
  5. Applied associate-*l/29.5

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

    \[\leadsto \frac{\color{blue}{\left(\left(z + x\right) \cdot y\right) \cdot \left(x - z\right)}}{x + z}\]
  7. Using strategy rm
  8. Applied associate-/l*0.0

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

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

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

Reproduce

herbie shell --seed 2019194 +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)))