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

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

Alternatives

Alternative 1
Error0.0
Cost320
\[y \cdot \left(x - z\right)\]
Alternative 2
Error14.8
Cost849
\[\begin{array}{l} \mathbf{if}\;z \leq -281.779488173179 \lor \neg \left(z \leq -2.4479504511337867 \cdot 10^{-25} \lor \neg \left(z \leq -1.7995205751645115 \cdot 10^{-60}\right) \land z \leq 5.812261980561112 \cdot 10^{-63}\right):\\ \;\;\;\;y \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array}\]
Alternative 3
Error30.4
Cost192
\[y \cdot x\]
Alternative 4
Error58.9
Cost64
\[0\]
Alternative 5
Error61.7
Cost64
\[1\]

Error

Derivation

  1. Initial program 17.9

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

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

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

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

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

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

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

Reproduce

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