Average Error: 1.9 → 1.9
Time: 4.4s
Precision: binary64
\[\frac{x}{y} \cdot \left(z - t\right) + t\]
\[\begin{array}{l} \mathbf{if}\;y \leq -9.286020151799416 \cdot 10^{-232}:\\ \;\;\;\;t + \left(\frac{x}{y} \cdot z - \frac{x}{y} \cdot t\right)\\ \mathbf{elif}\;y \leq 6.75286678036613 \cdot 10^{-142}:\\ \;\;\;\;t + \left(\frac{x \cdot z}{y} - \frac{x \cdot t}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;t + \frac{x}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \frac{z - t}{\sqrt[3]{y}}\\ \end{array}\]
\frac{x}{y} \cdot \left(z - t\right) + t
\begin{array}{l}
\mathbf{if}\;y \leq -9.286020151799416 \cdot 10^{-232}:\\
\;\;\;\;t + \left(\frac{x}{y} \cdot z - \frac{x}{y} \cdot t\right)\\

\mathbf{elif}\;y \leq 6.75286678036613 \cdot 10^{-142}:\\
\;\;\;\;t + \left(\frac{x \cdot z}{y} - \frac{x \cdot t}{y}\right)\\

\mathbf{else}:\\
\;\;\;\;t + \frac{x}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \frac{z - t}{\sqrt[3]{y}}\\

\end{array}
(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (- z t)) t))
(FPCore (x y z t)
 :precision binary64
 (if (<= y -9.286020151799416e-232)
   (+ t (- (* (/ x y) z) (* (/ x y) t)))
   (if (<= y 6.75286678036613e-142)
     (+ t (- (/ (* x z) y) (/ (* x t) y)))
     (+ t (* (/ x (* (cbrt y) (cbrt y))) (/ (- z t) (cbrt y)))))))
double code(double x, double y, double z, double t) {
	return ((x / y) * (z - t)) + t;
}
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -9.286020151799416e-232) {
		tmp = t + (((x / y) * z) - ((x / y) * t));
	} else if (y <= 6.75286678036613e-142) {
		tmp = t + (((x * z) / y) - ((x * t) / y));
	} else {
		tmp = t + ((x / (cbrt(y) * cbrt(y))) * ((z - t) / cbrt(y)));
	}
	return tmp;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original1.9
Target2.1
Herbie1.9
\[\begin{array}{l} \mathbf{if}\;z < 2.759456554562692 \cdot 10^{-282}:\\ \;\;\;\;\frac{x}{y} \cdot \left(z - t\right) + t\\ \mathbf{elif}\;z < 2.326994450874436 \cdot 10^{-110}:\\ \;\;\;\;x \cdot \frac{z - t}{y} + t\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \left(z - t\right) + t\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if y < -9.286020151799416e-232

    1. Initial program 1.7

      \[\frac{x}{y} \cdot \left(z - t\right) + t\]
    2. Using strategy rm
    3. Applied sub-neg_binary64_138321.7

      \[\leadsto \frac{x}{y} \cdot \color{blue}{\left(z + \left(-t\right)\right)} + t\]
    4. Applied distribute-rgt-in_binary64_137891.7

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

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

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

    if -9.286020151799416e-232 < y < 6.75286678036612954e-142

    1. Initial program 5.7

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

      \[\leadsto \frac{x}{\color{blue}{1 \cdot y}} \cdot \left(z - t\right) + t\]
    4. Applied add-cube-cbrt_binary64_138746.6

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}{1 \cdot y} \cdot \left(z - t\right) + t\]
    5. Applied times-frac_binary64_138456.6

      \[\leadsto \color{blue}{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1} \cdot \frac{\sqrt[3]{x}}{y}\right)} \cdot \left(z - t\right) + t\]
    6. Applied associate-*l*_binary64_1378021.9

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1} \cdot \left(\frac{\sqrt[3]{x}}{y} \cdot \left(z - t\right)\right)} + t\]
    7. Simplified21.9

      \[\leadsto \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1} \cdot \color{blue}{\left(\left(z - t\right) \cdot \frac{\sqrt[3]{x}}{y}\right)} + t\]
    8. Taylor expanded around 0 2.9

      \[\leadsto \color{blue}{\left(\frac{x \cdot z}{y} - \frac{t \cdot x}{y}\right)} + t\]
    9. Simplified2.9

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

    if 6.75286678036612954e-142 < y

    1. Initial program 1.1

      \[\frac{x}{y} \cdot \left(z - t\right) + t\]
    2. Using strategy rm
    3. Applied div-inv_binary64_138361.1

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

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

      \[\leadsto x \cdot \color{blue}{\frac{z - t}{y}} + t\]
    6. Using strategy rm
    7. Applied add-cube-cbrt_binary64_138744.1

      \[\leadsto x \cdot \frac{z - t}{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}} + t\]
    8. Applied *-un-lft-identity_binary64_138394.1

      \[\leadsto x \cdot \frac{\color{blue}{1 \cdot \left(z - t\right)}}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}} + t\]
    9. Applied times-frac_binary64_138454.1

      \[\leadsto x \cdot \color{blue}{\left(\frac{1}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \frac{z - t}{\sqrt[3]{y}}\right)} + t\]
    10. Applied associate-*r*_binary64_137791.9

      \[\leadsto \color{blue}{\left(x \cdot \frac{1}{\sqrt[3]{y} \cdot \sqrt[3]{y}}\right) \cdot \frac{z - t}{\sqrt[3]{y}}} + t\]
    11. Simplified1.9

      \[\leadsto \color{blue}{\frac{x}{\sqrt[3]{y} \cdot \sqrt[3]{y}}} \cdot \frac{z - t}{\sqrt[3]{y}} + t\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.286020151799416 \cdot 10^{-232}:\\ \;\;\;\;t + \left(\frac{x}{y} \cdot z - \frac{x}{y} \cdot t\right)\\ \mathbf{elif}\;y \leq 6.75286678036613 \cdot 10^{-142}:\\ \;\;\;\;t + \left(\frac{x \cdot z}{y} - \frac{x \cdot t}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;t + \frac{x}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \frac{z - t}{\sqrt[3]{y}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020289 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
  :precision binary64

  :herbie-target
  (if (< z 2.759456554562692e-282) (+ (* (/ x y) (- z t)) t) (if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t)))

  (+ (* (/ x y) (- z t)) t))