?

Average Error: 0.0 → 0.0
Time: 3.6s
Precision: binary64
Cost: 576

?

\[x \cdot y + \left(x - 1\right) \cdot z \]
\[x \cdot y + \left(x - 1\right) \cdot z \]
(FPCore (x y z) :precision binary64 (+ (* x y) (* (- x 1.0) z)))
(FPCore (x y z) :precision binary64 (+ (* x y) (* (- x 1.0) z)))
double code(double x, double y, double z) {
	return (x * y) + ((x - 1.0) * z);
}
double code(double x, double y, double z) {
	return (x * y) + ((x - 1.0) * 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 - 1.0d0) * 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 - 1.0d0) * z)
end function
public static double code(double x, double y, double z) {
	return (x * y) + ((x - 1.0) * z);
}
public static double code(double x, double y, double z) {
	return (x * y) + ((x - 1.0) * z);
}
def code(x, y, z):
	return (x * y) + ((x - 1.0) * z)
def code(x, y, z):
	return (x * y) + ((x - 1.0) * z)
function code(x, y, z)
	return Float64(Float64(x * y) + Float64(Float64(x - 1.0) * z))
end
function code(x, y, z)
	return Float64(Float64(x * y) + Float64(Float64(x - 1.0) * z))
end
function tmp = code(x, y, z)
	tmp = (x * y) + ((x - 1.0) * z);
end
function tmp = code(x, y, z)
	tmp = (x * y) + ((x - 1.0) * z);
end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] + N[(N[(x - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] + N[(N[(x - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
x \cdot y + \left(x - 1\right) \cdot z
x \cdot y + \left(x - 1\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 \cdot y + \left(x - 1\right) \cdot z \]
  2. Final simplification0.0

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

Alternatives

Alternative 1
Error23.7
Cost720
\[\begin{array}{l} \mathbf{if}\;x \leq -0.00075:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{-13}:\\ \;\;\;\;-z\\ \mathbf{elif}\;x \leq 3.65 \cdot 10^{+99}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{+206}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]
Alternative 2
Error0.8
Cost712
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\left(y + z\right) \cdot x\\ \mathbf{elif}\;x \leq 0.0003:\\ \;\;\;\;x \cdot y + \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + z \cdot x\\ \end{array} \]
Alternative 3
Error0.8
Cost648
\[\begin{array}{l} t_0 := \left(y + z\right) \cdot x\\ \mathbf{if}\;x \leq -1:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 0.0003:\\ \;\;\;\;x \cdot y + \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error12.3
Cost584
\[\begin{array}{l} t_0 := \left(y + z\right) \cdot x\\ \mathbf{if}\;x \leq -0.00075:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{-17}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error13.6
Cost584
\[\begin{array}{l} t_0 := \left(x - 1\right) \cdot z\\ \mathbf{if}\;z \leq -1.15 \cdot 10^{-140}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-90}:\\ \;\;\;\;\left(y + z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error13.7
Cost584
\[\begin{array}{l} \mathbf{if}\;z \leq -6.2 \cdot 10^{-143}:\\ \;\;\;\;z \cdot x - z\\ \mathbf{elif}\;z \leq 1.36 \cdot 10^{-89}:\\ \;\;\;\;\left(y + z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(x - 1\right) \cdot z\\ \end{array} \]
Alternative 7
Error24.0
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -0.00075:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq 1.42 \cdot 10^{-12}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]
Alternative 8
Error0.0
Cost448
\[x \cdot \left(z + y\right) - z \]
Alternative 9
Error35.1
Cost128
\[-z \]

Error

Reproduce?

herbie shell --seed 2023090 
(FPCore (x y z)
  :name "Graphics.Rendering.Chart.Drawing:drawTextsR from Chart-1.5.3"
  :precision binary64
  (+ (* x y) (* (- x 1.0) z)))