?

Average Accuracy: 99.7% → 99.7%
Time: 8.5s
Precision: binary64
Cost: 704

?

\[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
\[x + \left(6 \cdot y + x \cdot -6\right) \cdot z \]
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) z)))
(FPCore (x y z) :precision binary64 (+ x (* (+ (* 6.0 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 + (((6.0 * 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 + (((6.0d0 * 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 + (((6.0 * y) + (x * -6.0)) * z);
}
def code(x, y, z):
	return x + (((y - x) * 6.0) * z)
def code(x, y, z):
	return x + (((6.0 * 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(6.0 * y) + Float64(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 + (((6.0 * 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[(6.0 * y), $MachinePrecision] + N[(x * -6.0), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
x + \left(6 \cdot y + x \cdot -6\right) \cdot z

Error?

Bogosity?

Bogosity

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation?

  1. Initial program 99.8%

    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z \]
  2. Taylor expanded in y around 0 99.8%

    \[\leadsto x + \color{blue}{\left(6 \cdot y + -6 \cdot x\right)} \cdot z \]
  3. Final simplification99.8%

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

Alternatives

Alternative 1
Accuracy60.9%
Cost716
\[\begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{-77}:\\ \;\;\;\;\left(6 \cdot y\right) \cdot z\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-38}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 8.4 \cdot 10^{+104}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot -6\right) \cdot z\\ \end{array} \]
Alternative 2
Accuracy61.0%
Cost716
\[\begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{-77}:\\ \;\;\;\;\left(6 \cdot y\right) \cdot z\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{-38}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+104}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-6 \cdot z\right)\\ \end{array} \]
Alternative 3
Accuracy83.9%
Cost713
\[\begin{array}{l} \mathbf{if}\;z \leq -1.16 \cdot 10^{-76} \lor \neg \left(z \leq 1.65 \cdot 10^{-38}\right):\\ \;\;\;\;\left(y - x\right) \cdot \left(6 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 4
Accuracy98.7%
Cost713
\[\begin{array}{l} \mathbf{if}\;z \leq -0.165 \lor \neg \left(z \leq 0.17\right):\\ \;\;\;\;\left(y - x\right) \cdot \left(6 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(6 \cdot z\right)\\ \end{array} \]
Alternative 5
Accuracy61.2%
Cost585
\[\begin{array}{l} \mathbf{if}\;z \leq -3.15 \cdot 10^{-77} \lor \neg \left(z \leq 1.85 \cdot 10^{-38}\right):\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 6
Accuracy61.2%
Cost584
\[\begin{array}{l} \mathbf{if}\;z \leq -9.2 \cdot 10^{-82}:\\ \;\;\;\;6 \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{-38}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \end{array} \]
Alternative 7
Accuracy61.1%
Cost584
\[\begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{-86}:\\ \;\;\;\;\left(6 \cdot y\right) \cdot z\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-38}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \end{array} \]
Alternative 8
Accuracy99.7%
Cost576
\[x + z \cdot \left(6 \cdot \left(y - x\right)\right) \]
Alternative 9
Accuracy36.8%
Cost64
\[x \]

Error

Reproduce?

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