Average Error: 2.1 → 2.2
Time: 7.6s
Precision: binary64
\[\frac{x - y}{z - y} \cdot t \]
\[\begin{array}{l} \mathbf{if}\;t \leq -1.1171825476782533 \cdot 10^{+25}:\\ \;\;\;\;\begin{array}{l} t_1 := \sqrt[3]{x - y}\\ \left(t_1 \cdot t_1\right) \cdot \left(t \cdot \frac{t_1}{z - y}\right) \end{array}\\ \mathbf{elif}\;t \leq 2.9971915677477026 \cdot 10^{-68}:\\ \;\;\;\;\frac{t \cdot x}{z - y} - \frac{t \cdot y}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\frac{x}{z - y} - \frac{y}{z - y}\right)\\ \end{array} \]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;t \leq -1.1171825476782533 \cdot 10^{+25}:\\
\;\;\;\;\begin{array}{l}
t_1 := \sqrt[3]{x - y}\\
\left(t_1 \cdot t_1\right) \cdot \left(t \cdot \frac{t_1}{z - y}\right)
\end{array}\\

\mathbf{elif}\;t \leq 2.9971915677477026 \cdot 10^{-68}:\\
\;\;\;\;\frac{t \cdot x}{z - y} - \frac{t \cdot y}{z - y}\\

\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{x}{z - y} - \frac{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 (<= t -1.1171825476782533e+25)
   (let* ((t_1 (cbrt (- x y)))) (* (* t_1 t_1) (* t (/ t_1 (- z y)))))
   (if (<= t 2.9971915677477026e-68)
     (- (/ (* t x) (- z y)) (/ (* t y) (- z y)))
     (* t (- (/ x (- z y)) (/ 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 (t <= -1.1171825476782533e+25) {
		double t_1_1 = cbrt(x - y);
		tmp = (t_1_1 * t_1_1) * (t * (t_1_1 / (z - y)));
	} else if (t <= 2.9971915677477026e-68) {
		tmp = ((t * x) / (z - y)) - ((t * y) / (z - y));
	} else {
		tmp = t * ((x / (z - y)) - (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.0
Herbie2.2
\[\frac{t}{\frac{z - y}{x - y}} \]

Derivation

  1. Split input into 3 regimes
  2. if t < -1.1171825476782533e25

    1. Initial program 2.0

      \[\frac{x - y}{z - y} \cdot t \]
    2. Applied *-un-lft-identity_binary642.0

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

      \[\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 \]
    4. Applied times-frac_binary643.2

      \[\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 \]
    5. Applied associate-*l*_binary643.2

      \[\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)} \]
    6. Simplified3.2

      \[\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)} \]

    if -1.1171825476782533e25 < t < 2.99719156774770259e-68

    1. Initial program 2.2

      \[\frac{x - y}{z - y} \cdot t \]
    2. Taylor expanded in x around 0 2.0

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

    if 2.99719156774770259e-68 < t

    1. Initial program 1.9

      \[\frac{x - y}{z - y} \cdot t \]
    2. Taylor expanded in x around 0 1.9

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

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

Reproduce

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