?

Average Error: 0.2 → 0.2
Time: 9.0s
Precision: binary64
Cost: 576

?

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

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. Simplified0.2

    \[\leadsto \color{blue}{x + \left(y - x\right) \cdot \left(z \cdot 6\right)} \]
    Proof

    [Start]0.2

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

    rational_best.json-simplify-2 [=>]0.2

    \[ x + \color{blue}{z \cdot \left(\left(y - x\right) \cdot 6\right)} \]

    rational_best.json-simplify-44 [=>]0.2

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

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

Alternatives

Alternative 1
Error7.7
Cost712
\[\begin{array}{l} t_0 := x + 6 \cdot \left(z \cdot y\right)\\ \mathbf{if}\;y \leq -7.9 \cdot 10^{-116}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-24}:\\ \;\;\;\;x + -6 \cdot \left(z \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error7.7
Cost712
\[\begin{array}{l} t_0 := x + 6 \cdot \left(z \cdot y\right)\\ \mathbf{if}\;y \leq -2.95 \cdot 10^{-115}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-24}:\\ \;\;\;\;x + x \cdot \left(-6 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error7.8
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{-114}:\\ \;\;\;\;x + \left(6 \cdot y\right) \cdot z\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-21}:\\ \;\;\;\;x + x \cdot \left(-6 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + 6 \cdot \left(z \cdot y\right)\\ \end{array} \]
Alternative 4
Error0.2
Cost576
\[x + 6 \cdot \left(z \cdot \left(y - x\right)\right) \]
Alternative 5
Error23.8
Cost448
\[x + -6 \cdot \left(z \cdot x\right) \]

Error

Reproduce?

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