Average Error: 2.1 → 1.5
Time: 6.1s
Precision: binary64
\[\frac{x}{y} \cdot \left(z - t\right) + t\]
\[\begin{array}{l} \mathbf{if}\;x \le -3.97561591273634437 \cdot 10^{-31} \lor \neg \left(x \le 6.14205727121186749 \cdot 10^{109}\right):\\ \;\;\;\;x \cdot \frac{z - t}{y} + t\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \left(\frac{x}{\sqrt[3]{y}} \cdot \left(z - t\right)\right) + t\\ \end{array}\]
\frac{x}{y} \cdot \left(z - t\right) + t
\begin{array}{l}
\mathbf{if}\;x \le -3.97561591273634437 \cdot 10^{-31} \lor \neg \left(x \le 6.14205727121186749 \cdot 10^{109}\right):\\
\;\;\;\;x \cdot \frac{z - t}{y} + t\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \left(\frac{x}{\sqrt[3]{y}} \cdot \left(z - t\right)\right) + t\\

\end{array}
double code(double x, double y, double z, double t) {
	return ((double) (((double) (((double) (x / y)) * ((double) (z - t)))) + t));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if (((x <= -3.975615912736344e-31) || !(x <= 6.1420572712118675e+109))) {
		VAR = ((double) (((double) (x * ((double) (((double) (z - t)) / y)))) + t));
	} else {
		VAR = ((double) (((double) (((double) (1.0 / ((double) (((double) cbrt(y)) * ((double) cbrt(y)))))) * ((double) (((double) (x / ((double) cbrt(y)))) * ((double) (z - t)))))) + t));
	}
	return VAR;
}

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

Original2.1
Target2.4
Herbie1.5
\[\begin{array}{l} \mathbf{if}\;z \lt 2.7594565545626922 \cdot 10^{-282}:\\ \;\;\;\;\frac{x}{y} \cdot \left(z - t\right) + t\\ \mathbf{elif}\;z \lt 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 2 regimes
  2. if x < -3.97561591273634437e-31 or 6.14205727121186749e109 < x

    1. Initial program 4.0

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

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

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

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

    if -3.97561591273634437e-31 < x < 6.14205727121186749e109

    1. Initial program 1.2

      \[\frac{x}{y} \cdot \left(z - t\right) + t\]
    2. Using strategy rm
    3. Applied add-cube-cbrt1.6

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \left(\frac{x}{\sqrt[3]{y}} \cdot \left(z - t\right)\right)} + t\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -3.97561591273634437 \cdot 10^{-31} \lor \neg \left(x \le 6.14205727121186749 \cdot 10^{109}\right):\\ \;\;\;\;x \cdot \frac{z - t}{y} + t\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \left(\frac{x}{\sqrt[3]{y}} \cdot \left(z - t\right)\right) + t\\ \end{array}\]

Reproduce

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