Average Error: 13.0 → 0.0
Time: 3.1s
Precision: binary64
Cost: 448
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[y \cdot x - y \cdot z\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
y \cdot x - y \cdot z
(FPCore (x y z)
 :precision binary64
 (- (+ (- (* x y) (* y y)) (* y y)) (* y z)))
(FPCore (x y z) :precision binary64 (- (* y x) (* y z)))
double code(double x, double y, double z) {
	return (((x * y) - (y * y)) + (y * y)) - (y * z);
}
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

Original13.0
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 13.0

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

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

    \[\leadsto y \cdot \color{blue}{\left(x + \left(-z\right)\right)}\]
  5. Applied distribute-rgt-in_binary64_92350.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. Using strategy rm
  9. Applied distribute-rgt-neg-out_binary64_92450.0

    \[\leadsto y \cdot x + \color{blue}{\left(-y \cdot z\right)}\]
  10. Applied unsub-neg_binary64_92790.0

    \[\leadsto \color{blue}{y \cdot x - y \cdot z}\]
  11. Simplified0.0

    \[\leadsto \color{blue}{y \cdot x - y \cdot z}\]
  12. 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, D"
  :precision binary64

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

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