?

Average Error: 0.0 → 0.0
Time: 8.4s
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
Error15.7
Cost584
\[\begin{array}{l} t_0 := z \cdot \left(1 - x\right)\\ \mathbf{if}\;z \leq -1.75 \cdot 10^{-81}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-170}:\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error11.9
Cost584
\[\begin{array}{l} t_0 := \left(y - z\right) \cdot x\\ \mathbf{if}\;x \leq -1.7 \cdot 10^{-41}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 43000000:\\ \;\;\;\;z \cdot \left(1 - x\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error0.9
Cost584
\[\begin{array}{l} t_0 := \left(y - z\right) \cdot x\\ \mathbf{if}\;x \leq -370:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;x \cdot y + z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error23.6
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -1.5 \cdot 10^{-41}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{-21}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]
Alternative 5
Error0.0
Cost448
\[\left(y - z\right) \cdot x + z \]
Alternative 6
Error35.2
Cost64
\[z \]

Error

Reproduce?

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