?

Average Error: 0.0 → 0.0
Time: 8.8s
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
Error24.0
Cost852
\[\begin{array}{l} t_0 := z \cdot \left(-y\right)\\ \mathbf{if}\;y \leq -6 \cdot 10^{+193}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{+138}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;y \leq -1.3 \cdot 10^{+83}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -2.35 \cdot 10^{-51}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-81}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]
Alternative 2
Error1.0
Cost776
\[\begin{array}{l} \mathbf{if}\;y \leq -1:\\ \;\;\;\;y \cdot \left(x - z\right)\\ \mathbf{elif}\;y \leq 1.12 \cdot 10^{-9}:\\ \;\;\;\;x \cdot y + z\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + z \cdot \left(-y\right)\\ \end{array} \]
Alternative 3
Error13.2
Cost584
\[\begin{array}{l} t_0 := y \cdot \left(x - z\right)\\ \mathbf{if}\;y \leq -1.95 \cdot 10^{-51}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{-81}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error13.2
Cost584
\[\begin{array}{l} t_0 := y \cdot \left(x - z\right)\\ \mathbf{if}\;y \leq -4 \cdot 10^{-52}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{-81}:\\ \;\;\;\;z \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error1.0
Cost584
\[\begin{array}{l} t_0 := y \cdot \left(x - z\right)\\ \mathbf{if}\;y \leq -1:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.12 \cdot 10^{-9}:\\ \;\;\;\;x \cdot y + z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error24.3
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq -2.35 \cdot 10^{-51}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{-81}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]
Alternative 7
Error35.2
Cost64
\[z \]

Error

Reproduce?

herbie shell --seed 2023069 
(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))))