?

Average Error: 0.2 → 0.2
Time: 8.1s
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.2
Target0.2
Herbie0.2
\[x - \left(6 \cdot z\right) \cdot \left(x - y\right) \]

Derivation?

  1. Initial program 0.2

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

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

Alternatives

Alternative 1
Error23.9
Cost980
\[\begin{array}{l} t_0 := 6 \cdot \left(y \cdot z\right)\\ t_1 := -6 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -3.5 \cdot 10^{+51}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1150000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-56}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-16}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+82}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error23.9
Cost980
\[\begin{array}{l} t_0 := 6 \cdot \left(y \cdot z\right)\\ t_1 := z \cdot \left(x \cdot -6\right)\\ \mathbf{if}\;z \leq -4 \cdot 10^{+53}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1320000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-56}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-15}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+87}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error23.9
Cost980
\[\begin{array}{l} t_0 := 6 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -6 \cdot 10^{+58}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -930000000000:\\ \;\;\;\;z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-56}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{-16}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{+81}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \end{array} \]
Alternative 4
Error8.9
Cost978
\[\begin{array}{l} \mathbf{if}\;x \leq -5.6 \cdot 10^{+81} \lor \neg \left(x \leq -6.5 \cdot 10^{+48}\right) \land \left(x \leq -2.65 \cdot 10^{-25} \lor \neg \left(x \leq 0.066\right)\right):\\ \;\;\;\;x \cdot \left(1 + z \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;x + 6 \cdot \left(y \cdot z\right)\\ \end{array} \]
Alternative 5
Error8.9
Cost976
\[\begin{array}{l} t_0 := x + 6 \cdot \left(y \cdot z\right)\\ t_1 := x \cdot \left(1 + z \cdot -6\right)\\ \mathbf{if}\;x \leq -5.5 \cdot 10^{+81}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4 \cdot 10^{+48}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -5.8 \cdot 10^{-27}:\\ \;\;\;\;x + z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;x \leq 0.0145:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error15.8
Cost713
\[\begin{array}{l} \mathbf{if}\;x \leq -9 \cdot 10^{-76} \lor \neg \left(x \leq 1.9 \cdot 10^{-82}\right):\\ \;\;\;\;x \cdot \left(1 + z \cdot -6\right)\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \end{array} \]
Alternative 7
Error24.2
Cost585
\[\begin{array}{l} \mathbf{if}\;z \leq -0.072 \lor \neg \left(z \leq 0.16\right):\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 8
Error34.9
Cost64
\[x \]

Error

Reproduce?

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