Average Error: 0.4 → 0.1
Time: 13.5s
Precision: binary64
Cost: 832
\[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120\]
\[a \cdot 120 + 60 \cdot \frac{x - y}{z - t}\]
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
a \cdot 120 + 60 \cdot \frac{x - y}{z - t}
(FPCore (x y z t a)
 :precision binary64
 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
(FPCore (x y z t a)
 :precision binary64
 (+ (* a 120.0) (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
	return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
double code(double x, double y, double z, double t, double a) {
	return (a * 120.0) + (60.0 * ((x - y) / (z - t)));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.4
Target0.2
Herbie0.1
\[\frac{60}{\frac{z - t}{x - y}} + a \cdot 120\]

Alternatives

Alternative 1
Error0.2
Cost832
\[a \cdot 120 + \frac{60}{\frac{z - t}{x - y}}\]
Alternative 2
Error6.7
Cost1346
\[\begin{array}{l} \mathbf{if}\;x \leq -260020515.0067386:\\ \;\;\;\;a \cdot 120 + \frac{60 \cdot x}{z - t}\\ \mathbf{elif}\;x \leq 1.7373159833082848 \cdot 10^{+41}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z - t}\\ \end{array}\]
Alternative 3
Error6.8
Cost1032
\[\begin{array}{l} \mathbf{if}\;x \leq -1315.923661634787 \lor \neg \left(x \leq 6.047580941312403 \cdot 10^{+40}\right):\\ \;\;\;\;a \cdot 120 + \frac{60 \cdot x}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z - t}\\ \end{array}\]
Alternative 4
Error10.9
Cost1288
\[\begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -8.438214582973926 \cdot 10^{-40} \lor \neg \left(a \cdot 120 \leq 1.109109574260039 \cdot 10^{-54}\right):\\ \;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\ \end{array}\]
Alternative 5
Error11.0
Cost1288
\[\begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -4.950375599818289 \cdot 10^{-41} \lor \neg \left(a \cdot 120 \leq 1.431898629932874 \cdot 10^{-54}\right):\\ \;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\ \end{array}\]
Alternative 6
Error15.0
Cost1160
\[\begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -4521769711415.359 \lor \neg \left(a \cdot 120 \leq 4.188647153338975 \cdot 10^{-11}\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\ \end{array}\]
Alternative 7
Error25.6
Cost2693
\[\begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -5.7119562340904354 \cdot 10^{-40}:\\ \;\;\;\;a \cdot 120\\ \mathbf{elif}\;a \cdot 120 \leq -1.713304714660911 \cdot 10^{-223}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \cdot 120 \leq -3.905950029673212 \cdot 10^{-279}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{elif}\;a \cdot 120 \leq 3.073055670621317 \cdot 10^{-282}:\\ \;\;\;\;60 \cdot \frac{x}{z - t}\\ \mathbf{elif}\;a \cdot 120 \leq 3.7929893181978897 \cdot 10^{-25}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120\\ \end{array}\]
Alternative 8
Error25.4
Cost1032
\[\begin{array}{l} \mathbf{if}\;a \cdot 120 \leq -1.3535639017794501 \cdot 10^{-107} \lor \neg \left(a \cdot 120 \leq 1.1231346424430363 \cdot 10^{-26}\right):\\ \;\;\;\;a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;-60 \cdot \frac{y}{z - t}\\ \end{array}\]
Alternative 9
Error29.2
Cost192
\[a \cdot 120\]
Alternative 10
Error61.7
Cost64
\[-1\]
Alternative 11
Error61.8
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.4

    \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120\]
  2. Using strategy rm
  3. Applied *-un-lft-identity_binary64_239480.4

    \[\leadsto \frac{60 \cdot \left(x - y\right)}{\color{blue}{1 \cdot \left(z - t\right)}} + a \cdot 120\]
  4. Applied times-frac_binary64_239540.1

    \[\leadsto \color{blue}{\frac{60}{1} \cdot \frac{x - y}{z - t}} + a \cdot 120\]
  5. Simplified0.1

    \[\leadsto \color{blue}{60} \cdot \frac{x - y}{z - t} + a \cdot 120\]
  6. Simplified0.1

    \[\leadsto \color{blue}{a \cdot 120 + 60 \cdot \frac{x - y}{z - t}}\]
  7. Final simplification0.1

    \[\leadsto a \cdot 120 + 60 \cdot \frac{x - y}{z - t}\]

Reproduce

herbie shell --seed 2021044 
(FPCore (x y z t a)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
  :precision binary64

  :herbie-target
  (+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0))

  (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))