?

Average Accuracy: 99.6% → 99.6%
Time: 11.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

Original99.6%
Target99.7%
Herbie99.6%
\[x - \left(6 \cdot z\right) \cdot \left(x - y\right) \]

Derivation?

  1. Initial program 99.6%

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

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

Alternatives

Alternative 1
Accuracy78.8%
Cost976
\[\begin{array}{l} t_0 := 6 \cdot \left(\left(y - x\right) \cdot z\right)\\ t_1 := x \cdot \left(1 + z \cdot -6\right)\\ \mathbf{if}\;x \leq -4.4 \cdot 10^{-55}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.3 \cdot 10^{-191}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -6.4 \cdot 10^{-201}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.42 \cdot 10^{-46}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Accuracy60.5%
Cost849
\[\begin{array}{l} \mathbf{if}\;x \leq -9.6 \cdot 10^{-56}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -5.8 \cdot 10^{-187} \lor \neg \left(x \leq -6.4 \cdot 10^{-201}\right) \land x \leq 6 \cdot 10^{-57}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 3
Accuracy60.5%
Cost848
\[\begin{array}{l} \mathbf{if}\;x \leq -1.12 \cdot 10^{-52}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -2.3 \cdot 10^{-191}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;x \leq -6.4 \cdot 10^{-201}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 6.1 \cdot 10^{-43}:\\ \;\;\;\;z \cdot \left(y \cdot 6\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 4
Accuracy80.6%
Cost713
\[\begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{-50} \lor \neg \left(z \leq 1.85 \cdot 10^{-13}\right):\\ \;\;\;\;6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 5
Accuracy98.3%
Cost713
\[\begin{array}{l} \mathbf{if}\;z \leq -6200 \lor \neg \left(z \leq 0.0146\right):\\ \;\;\;\;6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + 6 \cdot \left(y \cdot z\right)\\ \end{array} \]
Alternative 6
Accuracy97.5%
Cost713
\[\begin{array}{l} \mathbf{if}\;z \leq -6200 \lor \neg \left(z \leq 1.25 \cdot 10^{+19}\right):\\ \;\;\;\;6 \cdot \left(\left(y - x\right) \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(y \cdot 6\right)\\ \end{array} \]
Alternative 7
Accuracy62.4%
Cost585
\[\begin{array}{l} \mathbf{if}\;z \leq -6200 \lor \neg \left(z \leq 0.17\right):\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 8
Accuracy45.6%
Cost64
\[x \]

Error

Reproduce?

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