Average Error: 17.3 → 0.0
Time: 4.9s
Precision: binary64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
\left(x - z\right) \cdot y
(FPCore (x y z)
 :precision binary64
 (+ (- (- (* x y) (* y z)) (* y y)) (* y y)))
(FPCore (x y z) :precision binary64 (* (- x z) y))
double code(double x, double y, double z) {
	return (((x * y) - (y * z)) - (y * y)) + (y * y);
}
double code(double x, double y, double z) {
	return (x - z) * y;
}

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

Derivation

  1. Initial program 17.3

    \[\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 pow1_binary64_178710.0

    \[\leadsto y \cdot \color{blue}{{\left(x - z\right)}^{1}}\]
  5. Applied pow1_binary64_178710.0

    \[\leadsto \color{blue}{{y}^{1}} \cdot {\left(x - z\right)}^{1}\]
  6. Applied pow-prod-down_binary64_178810.0

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

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

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

Reproduce

herbie shell --seed 2021076 
(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)))