Average Error: 0.2 → 0.2
Time: 6.2s
Precision: binary64
Cost: 576
\[x + \left(\left(y - x\right) \cdot 6\right) \cdot z\]
\[x + 6 \cdot \left(z \cdot \left(y - x\right)\right)\]
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
x + 6 \cdot \left(z \cdot \left(y - x\right)\right)
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) z)))
(FPCore (x y z) :precision binary64 (+ x (* 6.0 (* z (- y x)))))
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 * (z * (y - x)));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

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)\]

Alternatives

Alternative 1
Error1.1
Cost776
\[\begin{array}{l} \mathbf{if}\;z \leq -0.17658168814024838 \lor \neg \left(z \leq 0.16855120383818492\right):\\ \;\;\;\;z \cdot \left(6 \cdot \left(y - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + 6 \cdot \left(z \cdot y\right)\\ \end{array}\]
Alternative 2
Error1.2
Cost776
\[\begin{array}{l} \mathbf{if}\;z \leq -0.13620138991568423 \lor \neg \left(z \leq 0.16855120383818492\right):\\ \;\;\;\;\left(y - x\right) \cdot \left(6 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + 6 \cdot \left(z \cdot y\right)\\ \end{array}\]
Alternative 3
Error8.8
Cost1732
\[\begin{array}{l} \mathbf{if}\;x \leq -4.763446752376647 \cdot 10^{+52}:\\ \;\;\;\;x + -6 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;x \leq -8.42304440601199 \cdot 10^{-32}:\\ \;\;\;\;x + 6 \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;x \leq -1.6676184583370275 \cdot 10^{-62}:\\ \;\;\;\;x + z \cdot \left(x \cdot -6\right)\\ \mathbf{elif}\;x \leq 6.714509211945516 \cdot 10^{+41}:\\ \;\;\;\;x + 6 \cdot \left(z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x + -6 \cdot \left(x \cdot z\right)\\ \end{array}\]
Alternative 4
Error7.7
Cost776
\[\begin{array}{l} \mathbf{if}\;y \leq -9.211858850451974 \cdot 10^{-201} \lor \neg \left(y \leq 2.6887604965764204 \cdot 10^{-132}\right):\\ \;\;\;\;x + 6 \cdot \left(z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(x \cdot -6\right)\\ \end{array}\]
Alternative 5
Error12.3
Cost448
\[x + 6 \cdot \left(z \cdot y\right)\]
Alternative 6
Error23.8
Cost648
\[\begin{array}{l} \mathbf{if}\;z \leq -1.1661383091935057 \cdot 10^{-09} \lor \neg \left(z \leq 3.730656972945036 \cdot 10^{-58}\right):\\ \;\;\;\;y \cdot \left(6 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 7
Error35.0
Cost64
\[x\]
Alternative 8
Error61.8
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.2

    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z\]
  2. Using strategy rm
  3. Applied flip--_binary64_2290024.6

    \[\leadsto x + \left(\color{blue}{\frac{y \cdot y - x \cdot x}{y + x}} \cdot 6\right) \cdot z\]
  4. Applied associate-*l/_binary64_2286824.7

    \[\leadsto x + \color{blue}{\frac{\left(y \cdot y - x \cdot x\right) \cdot 6}{y + x}} \cdot z\]
  5. Simplified24.7

    \[\leadsto x + \frac{\color{blue}{6 \cdot \left(y \cdot y - x \cdot x\right)}}{y + x} \cdot z\]
  6. Taylor expanded around 0 0.2

    \[\leadsto x + \color{blue}{\left(6 \cdot \left(z \cdot y\right) - 6 \cdot \left(x \cdot z\right)\right)}\]
  7. Simplified0.2

    \[\leadsto x + \color{blue}{6 \cdot \left(\left(y - x\right) \cdot z\right)}\]
  8. Simplified0.2

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

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

Reproduce

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