Average Error: 0.0 → 0.0
Time: 3.5min
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
Error0.9
Cost648
\[\begin{array}{l} \mathbf{if}\;z \leq -0.9950466081840682 \lor \neg \left(z \leq 0.0008216671685301211\right):\\ \;\;\;\;\left(y - x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array}\]
Alternative 2
Error12.1
Cost969
\[\begin{array}{l} \mathbf{if}\;z \leq -1.4568315779274262 \cdot 10^{+147}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -1826387656589399.8 \lor \neg \left(z \leq 8.292128928072134 \cdot 10^{+34}\right):\\ \;\;\;\;-x \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array}\]
Alternative 3
Error24.1
Cost1861
\[\begin{array}{l} \mathbf{if}\;z \leq -5.077701771444963 \cdot 10^{+145}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -837947501421896.6:\\ \;\;\;\;-x \cdot z\\ \mathbf{elif}\;z \leq -4.889327508243104 \cdot 10^{-10}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq 3.404102865691425 \cdot 10^{-92}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.4336347601083633 \cdot 10^{+36}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;-x \cdot z\\ \end{array}\]
Alternative 4
Error25.3
Cost834
\[\begin{array}{l} \mathbf{if}\;x \leq -1.1619479395479008 \cdot 10^{-85}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.2266182740944937 \cdot 10^{-85}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 5
Error34.6
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_85330.0

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

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

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

Reproduce

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