?

Average Error: 0.3 → 0.3
Time: 6.5s
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
Error7.1
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{-78} \lor \neg \left(y \leq 5 \cdot 10^{-81}\right):\\ \;\;\;\;x + 6 \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + -6 \cdot \left(x \cdot z\right)\\ \end{array} \]
Alternative 2
Error7.0
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -7.4 \cdot 10^{-78}:\\ \;\;\;\;x + y \cdot \left(6 \cdot z\right)\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{-82}:\\ \;\;\;\;x + -6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + 6 \cdot \left(y \cdot z\right)\\ \end{array} \]
Alternative 3
Error7.1
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -9.6 \cdot 10^{-78}:\\ \;\;\;\;x + z \cdot \frac{y}{0.16666666666666666}\\ \mathbf{elif}\;y \leq 2.45 \cdot 10^{-82}:\\ \;\;\;\;x + -6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + 6 \cdot \left(y \cdot z\right)\\ \end{array} \]
Alternative 4
Error7.2
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{-78}:\\ \;\;\;\;x + z \cdot \frac{y}{0.16666666666666666}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-80}:\\ \;\;\;\;x + -6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(y \cdot 6\right)\\ \end{array} \]
Alternative 5
Error24.6
Cost585
\[\begin{array}{l} \mathbf{if}\;z \leq -1350000000000 \lor \neg \left(z \leq 72\right):\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 6
Error24.6
Cost584
\[\begin{array}{l} \mathbf{if}\;z \leq -1350000000000:\\ \;\;\;\;-6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq 72:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot -6\right)\\ \end{array} \]
Alternative 7
Error23.5
Cost448
\[x \cdot \left(z \cdot -6 + 1\right) \]
Alternative 8
Error23.5
Cost448
\[x + -6 \cdot \left(x \cdot z\right) \]
Alternative 9
Error35.1
Cost64
\[x \]

Error

Reproduce?

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