Average Error: 2.1 → 2.1
Time: 8.9s
Precision: binary64
Cost: 20616
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \leq -3.6399878561446166 \cdot 10^{-103} \lor \neg \left(y \leq 2.4182139109528022 \cdot 10^{-296}\right):\\ \;\;\;\;t \cdot \frac{x - y}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}\right) \cdot \left(t \cdot \frac{\sqrt[3]{x - y}}{z - y}\right)\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;y \leq -3.6399878561446166 \cdot 10^{-103} \lor \neg \left(y \leq 2.4182139109528022 \cdot 10^{-296}\right):\\
\;\;\;\;t \cdot \frac{x - y}{z - y}\\

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

\end{array}
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
(FPCore (x y z t)
 :precision binary64
 (if (or (<= y -3.6399878561446166e-103) (not (<= y 2.4182139109528022e-296)))
   (* t (/ (- x y) (- z y)))
   (* (* (cbrt (- x y)) (cbrt (- x y))) (* t (/ (cbrt (- x y)) (- z y))))))
double code(double x, double y, double z, double t) {
	return ((x - y) / (z - y)) * t;
}
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -3.6399878561446166e-103) || !(y <= 2.4182139109528022e-296)) {
		tmp = t * ((x - y) / (z - y));
	} else {
		tmp = (cbrt(x - y) * cbrt(x - y)) * (t * (cbrt(x - y) / (z - 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

Original2.1
Target2.1
Herbie2.1
\[\frac{t}{\frac{z - y}{x - y}}\]

Alternatives

Alternative 1
Error1.7
Cost1409
\[\begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \leq 1.387502400050649 \cdot 10^{+195}:\\ \;\;\;\;t \cdot \frac{x - y}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{z - y}{t \cdot \left(x - y\right)}}\\ \end{array}\]
Alternative 2
Error1.6
Cost1281
\[\begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \leq 1.6007126439202062 \cdot 10^{+216}:\\ \;\;\;\;t \cdot \frac{x - y}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y}{\frac{z - y}{t}}\\ \end{array}\]
Alternative 3
Error2.2
Cost904
\[\begin{array}{l} \mathbf{if}\;t \leq -1.40767092518502 \cdot 10^{+33} \lor \neg \left(t \leq 2.898877055568305 \cdot 10^{-36}\right):\\ \;\;\;\;\frac{x - y}{\frac{z - y}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \left(x - y\right)}{z - y}\\ \end{array}\]
Alternative 4
Error8.4
Cost1860
\[\begin{array}{l} \mathbf{if}\;y \leq -3.525824907060968 \cdot 10^{+129}:\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \mathbf{elif}\;y \leq 3.594613337010265 \cdot 10^{-289}:\\ \;\;\;\;\frac{t \cdot \left(x - y\right)}{z - y}\\ \mathbf{elif}\;y \leq 1.2959754135062816 \cdot 10^{-142}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;y \leq 3.0222160492804032 \cdot 10^{+100}:\\ \;\;\;\;\frac{t \cdot \left(x - y\right)}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \end{array}\]
Alternative 5
Error17.6
Cost2438
\[\begin{array}{l} \mathbf{if}\;z \leq -6.639300546884983 \cdot 10^{+137}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;z \leq -7.442136343304366 \cdot 10^{+103}:\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \mathbf{elif}\;z \leq -1.1137586544646253 \cdot 10^{-17}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;z \leq -6.059204683548443 \cdot 10^{-70}:\\ \;\;\;\;t \cdot \left(-\frac{y}{z - y}\right)\\ \mathbf{elif}\;z \leq 1.74448141155217 \cdot 10^{-127}:\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \mathbf{elif}\;z \leq 3.85800650526104 \cdot 10^{+62}:\\ \;\;\;\;t \cdot \left(-\frac{y}{z - y}\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \end{array}\]
Alternative 6
Error17.0
Cost776
\[\begin{array}{l} \mathbf{if}\;y \leq -3.574830395066524 \cdot 10^{-19} \lor \neg \left(y \leq 2.0613631863461637 \cdot 10^{+56}\right):\\ \;\;\;\;t \cdot \frac{y - x}{y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \end{array}\]
Alternative 7
Error21.8
Cost2053
\[\begin{array}{l} \mathbf{if}\;z \leq -6.639300546884983 \cdot 10^{+137}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;z \leq -9.163865475934495 \cdot 10^{+103}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -6.907201991687983 \cdot 10^{-45}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \mathbf{elif}\;z \leq 1.3524827658108075 \cdot 10^{-127}:\\ \;\;\;\;\frac{t \cdot \left(y - x\right)}{y}\\ \mathbf{elif}\;z \leq 7.4952751032772635 \cdot 10^{+62}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x - y}{z}\\ \end{array}\]
Alternative 8
Error24.3
Cost1925
\[\begin{array}{l} \mathbf{if}\;y \leq -2.6065230799284282 \cdot 10^{+151}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -5.536359091920371 \cdot 10^{-20}:\\ \;\;\;\;\frac{t \cdot \left(y - x\right)}{y}\\ \mathbf{elif}\;y \leq 3.438628285428713 \cdot 10^{-139}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 5.4162945233182605 \cdot 10^{-98}:\\ \;\;\;\;\frac{t \cdot \left(y - x\right)}{y}\\ \mathbf{elif}\;y \leq 7.735441981929651 \cdot 10^{+28}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array}\]
Alternative 9
Error25.0
Cost962
\[\begin{array}{l} \mathbf{if}\;y \leq -1.397427563751888 \cdot 10^{-17}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.571719478587357 \cdot 10^{+29}:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array}\]
Alternative 10
Error37.8
Cost706
\[\begin{array}{l} \mathbf{if}\;y \leq -7.76938455488459 \cdot 10^{-99}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 5.551125784651601 \cdot 10^{-25}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array}\]
Alternative 11
Error56.0
Cost64
\[0\]
Alternative 12
Error61.8
Cost64
\[1\]

Error

Derivation

  1. Split input into 2 regimes
  2. if y < -3.63998785614461661e-103 or 2.4182139109528022e-296 < y

    1. Initial program 1.4

      \[\frac{x - y}{z - y} \cdot t\]
    2. Simplified1.4

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

    if -3.63998785614461661e-103 < y < 2.4182139109528022e-296

    1. Initial program 5.4

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied *-un-lft-identity_binary64_82625.4

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

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

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

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

      \[\leadsto \frac{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}}{1} \cdot \color{blue}{\left(t \cdot \frac{\sqrt[3]{x - y}}{z - y}\right)}\]
    8. Simplified5.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.6399878561446166 \cdot 10^{-103} \lor \neg \left(y \leq 2.4182139109528022 \cdot 10^{-296}\right):\\ \;\;\;\;t \cdot \frac{x - y}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}\right) \cdot \left(t \cdot \frac{\sqrt[3]{x - y}}{z - y}\right)\\ \end{array}\]

Reproduce

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

  :herbie-target
  (/ t (/ (- z y) (- x y)))

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