Average Error: 0.3 → 0.1
Time: 1.3min
Precision: binary64
Cost: 832
\[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120\]
\[60 \cdot \frac{x - y}{z - t} + a \cdot 120\]
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
60 \cdot \frac{x - y}{z - t} + a \cdot 120
(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
 (+ (* 60.0 (/ (- x y) (- z t))) (* a 120.0)))
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 (60.0 * ((x - y) / (z - t))) + (a * 120.0);
}

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.3
Target0.2
Herbie0.1
\[\frac{60}{\frac{z - t}{x - y}} + a \cdot 120\]
Alternative 1
Accuracy0.1
Cost1088
\[60 \cdot \left(\frac{x}{z - t} - \frac{y}{z - t}\right) + a \cdot 120\]
Alternative 2
Accuracy0.2
Cost960
\[60 \cdot \left(\left(x - y\right) \cdot \frac{1}{z - t}\right) + a \cdot 120\]
Alternative 3
Accuracy15.3
Cost2308
\[\begin{array}{l} \mathbf{if}\;x - y \leq -4.278731232916396 \cdot 10^{+161} \lor \neg \left(x - y \leq 1.0472799473220332 \cdot 10^{+148}\right):\\ \;\;\;\;\left(\sqrt{60} \cdot \sqrt{\frac{x - y}{z - t}}\right) \cdot \left(\sqrt{60} \cdot \sqrt{\frac{x - y}{z - t}}\right) + a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + 60 \cdot \frac{x \cdot x - y \cdot y}{\left(z - t\right) \cdot \left(x + y\right)}\\ \end{array}\]
Alternative 4
Accuracy22.0
Cost2953
\[\begin{array}{l} \mathbf{if}\;z - t \leq -1.031197125677278 \cdot 10^{+135} \lor \neg \left(z - t \leq -2.5715555734147015 \cdot 10^{-36} \lor \neg \left(z - t \leq 6.173118635046132 \cdot 10^{-78}\right) \land z - t \leq 2.4785346657508725 \cdot 10^{+108}\right):\\ \;\;\;\;\left(\sqrt{60} \cdot \sqrt{\frac{x - y}{z - t}}\right) \cdot \left(\sqrt{60} \cdot \sqrt{\frac{x - y}{z - t}}\right) + a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + 60 \cdot \left(\frac{x - y}{{z}^{3} - {t}^{3}} \cdot \left(z \cdot z + \left(t \cdot t + z \cdot t\right)\right)\right)\\ \end{array}\]
Alternative 5
Accuracy30.1
Cost2052
\[\begin{array}{l} \mathbf{if}\;y \leq 1.6791842293715994 \cdot 10^{+49} \lor \neg \left(y \leq 1.676151156904158 \cdot 10^{+142}\right):\\ \;\;\;\;\left(\sqrt{60} \cdot \sqrt{\frac{x - y}{z - t}}\right) \cdot \left(\sqrt{60} \cdot \sqrt{\frac{x - y}{z - t}}\right) + a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + \left(60 \cdot \left(\sqrt{x} + \sqrt{y}\right)\right) \cdot \frac{\sqrt{x} - \sqrt{y}}{z - t}\\ \end{array}\]
Alternative 6
Accuracy30.1
Cost2052
\[\begin{array}{l} \mathbf{if}\;y \leq 2.607214068924781 \cdot 10^{+44} \lor \neg \left(y \leq 7.983200152211222 \cdot 10^{+137}\right):\\ \;\;\;\;\left(\sqrt{60} \cdot \sqrt{\frac{x - y}{z - t}}\right) \cdot \left(\sqrt{60} \cdot \sqrt{\frac{x - y}{z - t}}\right) + a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + \left(60 \cdot \left(\sqrt{x} + \sqrt{y}\right)\right) \cdot \frac{\sqrt{x} - \sqrt{y}}{z - t}\\ \end{array}\]
Alternative 7
Accuracy30.1
Cost2052
\[\begin{array}{l} \mathbf{if}\;y \leq 2.8018150238280678 \cdot 10^{+48} \lor \neg \left(y \leq 2.0734459139527444 \cdot 10^{+143}\right):\\ \;\;\;\;\left(\sqrt{60} \cdot \sqrt{\frac{x - y}{z - t}}\right) \cdot \left(\sqrt{60} \cdot \sqrt{\frac{x - y}{z - t}}\right) + a \cdot 120\\ \mathbf{else}:\\ \;\;\;\;a \cdot 120 + \left(60 \cdot \left(\sqrt{x} + \sqrt{y}\right)\right) \cdot \frac{\sqrt{x} - \sqrt{y}}{z - t}\\ \end{array}\]
Alternative 8
Accuracy30.4
Cost1728
\[\left(\sqrt{60} \cdot \sqrt{\frac{x - y}{z - t}}\right) \cdot \left(\sqrt{60} \cdot \sqrt{\frac{x - y}{z - t}}\right) + a \cdot 120\]

Derivation

  1. Initial program 0.3

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

    \[\leadsto \frac{60 \cdot \left(x - y\right)}{\color{blue}{1 \cdot \left(z - t\right)}} + a \cdot 120\]
  4. Applied times-frac_binary64_242950.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. Using strategy rm
  7. Applied *-un-lft-identity_binary64_242890.1

    \[\leadsto 60 \cdot \frac{x - y}{\color{blue}{1 \cdot \left(z - t\right)}} + a \cdot 120\]
  8. Applied *-un-lft-identity_binary64_242890.1

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

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

    \[\leadsto 60 \cdot \left(\color{blue}{1} \cdot \frac{x - y}{z - t}\right) + a \cdot 120\]
  11. Using strategy rm
  12. Applied *-un-lft-identity_binary64_242890.1

    \[\leadsto 60 \cdot \left(1 \cdot \frac{x - y}{z - \color{blue}{1 \cdot t}}\right) + a \cdot 120\]
  13. Applied *-un-lft-identity_binary64_242890.1

    \[\leadsto 60 \cdot \left(1 \cdot \frac{x - y}{\color{blue}{1 \cdot z} - 1 \cdot t}\right) + a \cdot 120\]
  14. Applied distribute-lft-out--_binary64_242410.1

    \[\leadsto 60 \cdot \left(1 \cdot \frac{x - y}{\color{blue}{1 \cdot \left(z - t\right)}}\right) + a \cdot 120\]
  15. Applied *-un-lft-identity_binary64_242890.1

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

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

    \[\leadsto 60 \cdot \left(1 \cdot \left(\color{blue}{1} \cdot \frac{x - y}{z - t}\right)\right) + a \cdot 120\]
  18. Using strategy rm
  19. Applied pow1_binary64_243500.1

    \[\leadsto \color{blue}{{\left(60 \cdot \left(1 \cdot \left(1 \cdot \frac{x - y}{z - t}\right)\right)\right)}^{1}} + a \cdot 120\]
  20. Final simplification0.1

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

Reproduce

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