?

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 \]
(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 + \left(y - x\right) \cdot z
x + \left(y - x\right) \cdot z

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.0

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

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

Alternatives

Alternative 1
Error23.7
Cost1180
\[\begin{array}{l} t_0 := z \cdot \left(-x\right)\\ \mathbf{if}\;z \leq -5.5 \cdot 10^{+14}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{-22}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-13}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3050000:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+111}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{+224}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;z \leq 6.6 \cdot 10^{+261}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;z \cdot y\\ \end{array} \]
Alternative 2
Error12.2
Cost584
\[\begin{array}{l} t_0 := \left(y - x\right) \cdot z\\ \mathbf{if}\;z \leq -1.82 \cdot 10^{-22}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error0.9
Cost584
\[\begin{array}{l} t_0 := \left(y - x\right) \cdot z\\ \mathbf{if}\;z \leq -125:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-6}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error23.9
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{-22}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-13}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot y\\ \end{array} \]
Alternative 5
Error35.7
Cost64
\[x \]

Error

Reproduce?

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