Average Error: 2.2 → 2.1
Time: 9.0s
Precision: binary64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \leq 5.704566056545378 \cdot 10^{-299} \lor \neg \left(y \leq 2.795632804998043 \cdot 10^{-116}\right):\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \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 5.704566056545378 \cdot 10^{-299} \lor \neg \left(y \leq 2.795632804998043 \cdot 10^{-116}\right):\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\

\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 5.704566056545378e-299) (not (<= y 2.795632804998043e-116)))
   (* (/ (- x y) (- z y)) t)
   (* (* (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 <= 5.704566056545378e-299) || !(y <= 2.795632804998043e-116)) {
		tmp = ((x - y) / (z - y)) * t;
	} 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.2
Target2.2
Herbie2.1
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 2 regimes
  2. if y < 5.7045660565453784e-299 or 2.79563280499804283e-116 < y

    1. Initial program 1.6

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

    if 5.7045660565453784e-299 < y < 2.79563280499804283e-116

    1. Initial program 6.2

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

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

      \[\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_116787.0

      \[\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_116134.8

      \[\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. Simplified4.8

      \[\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)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification2.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 5.704566056545378 \cdot 10^{-299} \lor \neg \left(y \leq 2.795632804998043 \cdot 10^{-116}\right):\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \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 2020342 
(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))