Average Error: 0.0 → 0.0
Time: 1.7min
Precision: binary64
Cost: 448
\[x + \frac{y - x}{z}\]
\[x + \frac{y - x}{z}\]
x + \frac{y - x}{z}
x + \frac{y - x}{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 -1.0081080980265853 \lor \neg \left(z \leq 1.0096100883260688\right):\\ \;\;\;\;x + \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - x}{z}\\ \end{array}\]
Alternative 2
Error7.5
Cost648
\[\begin{array}{l} \mathbf{if}\;y \leq -1.5516536084389152 \cdot 10^{-130} \lor \neg \left(y \leq 1.4187696900043743 \cdot 10^{-148}\right):\\ \;\;\;\;x + \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{x}{z}\\ \end{array}\]
Alternative 3
Error16.2
Cost1178
\[\begin{array}{l} \mathbf{if}\;x \leq -2.408078771633287 \cdot 10^{-74} \lor \neg \left(x \leq -1.0843876553453599 \cdot 10^{-137} \lor \neg \left(x \leq -9.577831527727277 \cdot 10^{-158}\right) \land \left(x \leq 1.2944207908337052 \cdot 10^{-127} \lor \neg \left(x \leq 1.735832671204082 \cdot 10^{-117}\right) \land x \leq 9.251475128363361 \cdot 10^{-37}\right)\right):\\ \;\;\;\;x - \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z}\\ \end{array}\]
Alternative 4
Error23.5
Cost1476
\[\begin{array}{l} \mathbf{if}\;z \leq -4.334045885144298 \cdot 10^{+42}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.9604328605987303 \cdot 10^{-30}:\\ \;\;\;\;\frac{y}{z}\\ \mathbf{elif}\;z \leq -2.960284388334264 \cdot 10^{-191}:\\ \;\;\;\;\frac{-x}{z}\\ \mathbf{elif}\;z \leq 3078.309954677097:\\ \;\;\;\;\frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 5
Error24.9
Cost834
\[\begin{array}{l} \mathbf{if}\;x \leq -7.18768673884761 \cdot 10^{-75}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 3.79913320538792 \cdot 10^{-30}:\\ \;\;\;\;\frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 6
Error34.8
Cost64
\[x\]
Alternative 7
Error61.8
Cost64
\[-1\]

Error

Derivation

  1. Initial program 0.0

    \[x + \frac{y - x}{z}\]
  2. Using strategy rm
  3. Applied pow1_binary64_1390.0

    \[\leadsto x + \color{blue}{{\left(\frac{y - x}{z}\right)}^{1}}\]
  4. Using strategy rm
  5. Applied pow1_binary64_1390.0

    \[\leadsto \color{blue}{{\left(x + {\left(\frac{y - x}{z}\right)}^{1}\right)}^{1}}\]
  6. Simplified0.0

    \[\leadsto \color{blue}{x + \frac{y - x}{z}}\]
  7. Final simplification0.0

    \[\leadsto x + \frac{y - x}{z}\]

Reproduce

herbie shell --seed 2021014 
(FPCore (x y z)
  :name "Statistics.Sample:$swelfordMean from math-functions-0.1.5.2"
  :precision binary64
  (+ x (/ (- y x) z)))