?

Average Error: 0.02% → 0.02%
Time: 7.3s
Precision: binary64
Cost: 448

?

\[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);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x + ((y - x) / z)
end function
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x + ((y - x) / z)
end function
public static double code(double x, double y, double z) {
	return x + ((y - x) / z);
}
public static double code(double x, double y, double z) {
	return x + ((y - x) / z);
}
def code(x, y, z):
	return x + ((y - x) / z)
def code(x, y, z):
	return x + ((y - x) / z)
function code(x, y, z)
	return Float64(x + Float64(Float64(y - x) / z))
end
function code(x, y, z)
	return Float64(x + Float64(Float64(y - x) / z))
end
function tmp = code(x, y, z)
	tmp = x + ((y - x) / z);
end
function tmp = code(x, y, z)
	tmp = x + ((y - x) / z);
end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
x + \frac{y - x}{z}
x + \frac{y - x}{z}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.02

    \[x + \frac{y - x}{z} \]
  2. Final simplification0.02

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

Alternatives

Alternative 1
Error36.78%
Cost588
\[\begin{array}{l} \mathbf{if}\;z \leq -0.015:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-83}:\\ \;\;\;\;\frac{-x}{z}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+20}:\\ \;\;\;\;\frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 2
Error18.66%
Cost585
\[\begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{-7} \lor \neg \left(z \leq -2.65 \cdot 10^{-83}\right):\\ \;\;\;\;x + \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{z}\\ \end{array} \]
Alternative 3
Error13.39%
Cost585
\[\begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{+44} \lor \neg \left(x \leq 180000000000\right):\\ \;\;\;\;x - \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{z}\\ \end{array} \]
Alternative 4
Error1.36%
Cost585
\[\begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\ \;\;\;\;x + \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - x}{z}\\ \end{array} \]
Alternative 5
Error35.83%
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -40000000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{+21}:\\ \;\;\;\;\frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 6
Error54.19%
Cost64
\[x \]

Error

Reproduce?

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