Average Error: 0.0 → 0.0
Time: 2.3s
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
Error1.4
Cost648
\[\begin{array}{l} \mathbf{if}\;z \leq -7.933072930762098 \cdot 10^{+19} \lor \neg \left(z \leq 0.003184879307326393\right):\\ \;\;\;\;x + \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - x}{z}\\ \end{array}\]
Alternative 2
Error11.9
Cost320
\[x + \frac{y}{z}\]
Alternative 3
Error23.5
Cost834
\[\begin{array}{l} \mathbf{if}\;z \leq -1.2107934098437505 \cdot 10^{+20}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.0422010520902255 \cdot 10^{+63}:\\ \;\;\;\;\frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 4
Error34.8
Cost64
\[x\]
Alternative 5
Error61.8
Cost64
\[-1\]
Alternative 6
Error61.8
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.0

    \[x + \frac{y - x}{z}\]
  2. Simplified0.0

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

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

Reproduce

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