?

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

?

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

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

Alternatives

Alternative 1
Error23.9
Cost1180
\[\begin{array}{l} t_0 := z \cdot \left(-x\right)\\ \mathbf{if}\;x \leq -2.4 \cdot 10^{+32}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{-35}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-51}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 8.4 \cdot 10^{+33}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq 1.85 \cdot 10^{+64}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{+99}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq 6 \cdot 10^{+168}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]
Alternative 2
Error17.4
Cost848
\[\begin{array}{l} t_0 := z \cdot \left(1 - x\right)\\ \mathbf{if}\;z \leq -6.6 \cdot 10^{-72}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-215}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-263}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{-132}:\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error12.5
Cost584
\[\begin{array}{l} t_0 := \left(y - z\right) \cdot x\\ \mathbf{if}\;x \leq -800:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.75 \cdot 10^{-50}:\\ \;\;\;\;z \cdot \left(1 - x\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error0.9
Cost584
\[\begin{array}{l} t_0 := \left(y - z\right) \cdot x\\ \mathbf{if}\;x \leq -1:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;x \cdot y + z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error24.2
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -1.5 \cdot 10^{-34}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{-54}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]
Alternative 6
Error0.0
Cost448
\[\left(y - z\right) \cdot x + z \]
Alternative 7
Error35.5
Cost64
\[z \]

Error

Reproduce?

herbie shell --seed 2023094 
(FPCore (x y z)
  :name "Diagrams.Backend.Rasterific:$crender from diagrams-rasterific-1.3.1.3"
  :precision binary64
  (+ (* x y) (* (- 1.0 x) z)))