?

Average Error: 0.3 → 0.3
Time: 14.2s
Precision: binary64
Cost: 576

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation?

  1. Initial program 0.3

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

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

Alternatives

Alternative 1
Error12.5
Cost712
\[\begin{array}{l} t_0 := z \cdot \left(\left(y - x\right) \cdot 6\right)\\ \mathbf{if}\;z \leq -5.2 \cdot 10^{-28}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-37}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error12.3
Cost712
\[\begin{array}{l} t_0 := z \cdot \left(\left(y - x\right) \cdot 6\right)\\ \mathbf{if}\;z \leq -8.5:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-40}:\\ \;\;\;\;\left(1 + -6 \cdot z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error1.1
Cost712
\[\begin{array}{l} t_0 := z \cdot \left(\left(y - x\right) \cdot 6\right)\\ \mathbf{if}\;z \leq -0.15:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 0.16:\\ \;\;\;\;x + 6 \cdot \left(z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error24.4
Cost584
\[\begin{array}{l} t_0 := -6 \cdot \left(z \cdot x\right)\\ \mathbf{if}\;z \leq -0.165:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 30000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error23.3
Cost584
\[\begin{array}{l} t_0 := 6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -1.9 \cdot 10^{-10}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-36}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error34.8
Cost64
\[x \]

Error

Reproduce?

herbie shell --seed 2023069 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, E"
  :precision binary64

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

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