?

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

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[z - \left(z - x\right) \cdot y \]

Derivation?

  1. Initial program 0.0

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

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

Alternatives

Alternative 1
Error23.1
Cost1180
\[\begin{array}{l} t_0 := y \cdot \left(-z\right)\\ \mathbf{if}\;y \leq -1.35 \cdot 10^{+95}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;y \leq -3.7 \cdot 10^{+59}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{-45}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{-26}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+15}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{+177}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+225}:\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error13.3
Cost584
\[\begin{array}{l} t_0 := y \cdot \left(x - z\right)\\ \mathbf{if}\;y \leq -1.5 \cdot 10^{-128}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-15}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error0.9
Cost584
\[\begin{array}{l} t_0 := y \cdot \left(x - z\right)\\ \mathbf{if}\;y \leq -9.6:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1:\\ \;\;\;\;z + y \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error25.1
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{-28}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-72}:\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
Alternative 5
Error0.0
Cost448
\[z + y \cdot \left(x - z\right) \]
Alternative 6
Error34.4
Cost64
\[z \]

Error

Reproduce?

herbie shell --seed 2023073 
(FPCore (x y z)
  :name "Diagrams.TwoD.Segment:bezierClip from diagrams-lib-1.3.0.3"
  :precision binary64

  :herbie-target
  (- z (* (- z x) y))

  (+ (* x y) (* z (- 1.0 y))))