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

Original0.0
Target0.0
Herbie0.0
\[z - \left(z - x\right) \cdot y\]
Alternative 1
Accuracy0.0
Cost576
\[\left(z + y \cdot x\right) - z \cdot y\]
Alternative 2
Accuracy0.3
Cost1024
\[\left(z + y \cdot x\right) - y \cdot \left(\sqrt[3]{z} \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)\right)\]
Alternative 3
Accuracy31.5
Cost832
\[\left(z + y \cdot x\right) - y \cdot \left(\sqrt{z} \cdot \sqrt{z}\right)\]

Derivation

  1. Initial program 0.0

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

    \[\leadsto \color{blue}{z + y \cdot \left(x - z\right)}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity_binary64_174690.0

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

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

Reproduce

herbie shell --seed 2020322 
(FPCore (x y z)
  :name "Diagrams.TwoD.Segment:bezierClip from diagrams-lib-1.3.0.3"
  :precision binary64

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

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