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

Alternatives

Alternative 1
Error1.4
Cost648
\[\begin{array}{l} \mathbf{if}\;z \leq -8.953042990058884 \cdot 10^{+24} \lor \neg \left(z \leq 1.018067930420241\right):\\ \;\;\;\;\left(y - x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array}\]
Alternative 2
Error12.4
Cost648
\[\begin{array}{l} \mathbf{if}\;z \leq -2.1722713831908392 \cdot 10^{-09} \lor \neg \left(z \leq 1.3690179349825641 \cdot 10^{-58}\right):\\ \;\;\;\;\left(y - x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot z\\ \end{array}\]
Alternative 3
Error12.4
Cost648
\[\begin{array}{l} \mathbf{if}\;z \leq -7.82692955336557 \cdot 10^{-10} \lor \neg \left(z \leq 1.3690179349825641 \cdot 10^{-58}\right):\\ \;\;\;\;\left(y - x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 4
Error23.7
Cost520
\[\begin{array}{l} \mathbf{if}\;z \leq -7.82692955336557 \cdot 10^{-10} \lor \neg \left(z \leq 3.581400428508114 \cdot 10^{-58}\right):\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 5
Error34.9
Cost64
\[x\]
Alternative 6
Error61.8
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.0

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

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

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

Reproduce

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