?

Average Error: 0.1 → 0.1
Time: 7.3s
Precision: binary64
Cost: 576

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0.1
Herbie0.1
\[\left(x + 5\right) \cdot z + x \cdot y \]

Derivation?

  1. Initial program 0.1

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

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

Alternatives

Alternative 1
Error24.5
Cost984
\[\begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{+68}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq -9.5 \cdot 10^{+36}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-18}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq -1.62 \cdot 10^{-83}:\\ \;\;\;\;z \cdot 5\\ \mathbf{elif}\;x \leq -1.16 \cdot 10^{-120}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq 8.8 \cdot 10^{-51}:\\ \;\;\;\;z \cdot 5\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]
Alternative 2
Error16.7
Cost848
\[\begin{array}{l} t_0 := z \cdot \left(x - -5\right)\\ \mathbf{if}\;z \leq -1.55 \cdot 10^{-71}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-126}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-217}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-92}:\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error12.9
Cost848
\[\begin{array}{l} t_0 := \left(y + z\right) \cdot x\\ \mathbf{if}\;x \leq -6.5 \cdot 10^{-16}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -1.85 \cdot 10^{-83}:\\ \;\;\;\;z \cdot 5\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{-120}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq 1.75 \cdot 10^{-51}:\\ \;\;\;\;z \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error24.6
Cost720
\[\begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{-15}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq -2.8 \cdot 10^{-82}:\\ \;\;\;\;z \cdot 5\\ \mathbf{elif}\;x \leq -9.5 \cdot 10^{-121}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-51}:\\ \;\;\;\;z \cdot 5\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]
Alternative 5
Error0.9
Cost712
\[\begin{array}{l} t_0 := \left(y + z\right) \cdot x\\ \mathbf{if}\;x \leq -245000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 0.26:\\ \;\;\;\;y \cdot x + z \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error0.9
Cost712
\[\begin{array}{l} \mathbf{if}\;x \leq -245000:\\ \;\;\;\;\left(y + z\right) \cdot x\\ \mathbf{elif}\;x \leq 0.26:\\ \;\;\;\;y \cdot x + z \cdot 5\\ \mathbf{else}:\\ \;\;\;\;y \cdot x + z \cdot x\\ \end{array} \]
Alternative 7
Error39.4
Cost192
\[y \cdot x \]

Error

Reproduce?

herbie shell --seed 2023074 
(FPCore (x y z)
  :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, C"
  :precision binary64

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

  (+ (* x (+ y z)) (* z 5.0)))