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

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

Alternatives

Alternative 1
Error0.8
Cost648
\[\begin{array}{l} \mathbf{if}\;z \leq -1.0156882816974229 \lor \neg \left(z \leq 1.002031271848288\right):\\ \;\;\;\;z \cdot \left(y - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot y\\ \end{array}\]
Alternative 2
Error12.2
Cost648
\[\begin{array}{l} \mathbf{if}\;z \leq -8.703483155628362 \cdot 10^{-34} \lor \neg \left(z \leq 7.423582860353716 \cdot 10^{-38}\right):\\ \;\;\;\;z \cdot \left(y - x\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 3
Error23.4
Cost2503
\[\begin{array}{l} \mathbf{if}\;z \leq -6.173643132510311 \cdot 10^{+153}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;z \leq -4.64017936705747 \cdot 10^{+97}:\\ \;\;\;\;-x \cdot z\\ \mathbf{elif}\;z \leq -3.343048753855634 \cdot 10^{+59}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;z \leq -4.804150411558862 \cdot 10^{+25}:\\ \;\;\;\;-x \cdot z\\ \mathbf{elif}\;z \leq -1.0263883322876679 \cdot 10^{-33}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;z \leq 1.6454526886463466 \cdot 10^{-42}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.0778055723519505 \cdot 10^{+106}:\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;-x \cdot z\\ \end{array}\]
Alternative 4
Error23.5
Cost520
\[\begin{array}{l} \mathbf{if}\;z \leq -2.906930343184931 \cdot 10^{-34} \lor \neg \left(z \leq 1.88562760211355 \cdot 10^{-42}\right):\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 5
Error34.8
Cost64
\[x\]

Error

Time

Derivation

  1. Initial program 0.0

    \[x + \left(y - x\right) \cdot z\]
  2. Using strategy rm
  3. Applied *-commutative_binary64_92160.0

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

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

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

Reproduce

herbie shell --seed 2021065 
(FPCore (x y z)
  :name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, B"
  :precision binary64
  (+ x (* (- y x) z)))