Average Error: 2.2 → 2.5
Time: 12.9s
Precision: binary64
\[\frac{x - y}{z - y} \cdot t \]
\[\begin{array}{l} \mathbf{if}\;t \leq -5.150743828419859 \cdot 10^{+115} \lor \neg \left(t \leq -3.3018215432180023 \cdot 10^{-248}\right):\\ \;\;\;\;t \cdot \frac{x - y}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\begin{array}{l} t_1 := \sqrt[3]{z - y}\\ \frac{t \cdot x}{z - y} - \frac{y}{t_1 \cdot t_1} \cdot \frac{t}{t_1} \end{array}\\ \end{array} \]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;t \leq -5.150743828419859 \cdot 10^{+115} \lor \neg \left(t \leq -3.3018215432180023 \cdot 10^{-248}\right):\\
\;\;\;\;t \cdot \frac{x - y}{z - y}\\

\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \sqrt[3]{z - y}\\
\frac{t \cdot x}{z - y} - \frac{y}{t_1 \cdot t_1} \cdot \frac{t}{t_1}
\end{array}\\


\end{array}
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
(FPCore (x y z t)
 :precision binary64
 (if (or (<= t -5.150743828419859e+115) (not (<= t -3.3018215432180023e-248)))
   (* t (/ (- x y) (- z y)))
   (let* ((t_1 (cbrt (- z y))))
     (- (/ (* t x) (- z y)) (* (/ y (* t_1 t_1)) (/ t t_1))))))
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 <= -5.150743828419859e+115) || !(t <= -3.3018215432180023e-248)) {
		tmp = t * ((x - y) / (z - y));
	} else {
		double t_1 = cbrt(z - y);
		tmp = ((t * x) / (z - y)) - ((y / (t_1 * t_1)) * (t / t_1));
	}
	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.5
\[\frac{t}{\frac{z - y}{x - y}} \]

Derivation

  1. Split input into 2 regimes
  2. if t < -5.1507438284198586e115 or -3.30182154321800235e-248 < t

    1. Initial program 2.3

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

    if -5.1507438284198586e115 < t < -3.30182154321800235e-248

    1. Initial program 2.0

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

      \[\leadsto \color{blue}{\frac{t \cdot x}{z - y} - \frac{y \cdot t}{z - y}} \]
    3. Applied add-cube-cbrt_binary644.5

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

      \[\leadsto \frac{t \cdot x}{z - y} - \color{blue}{\frac{y}{\sqrt[3]{z - y} \cdot \sqrt[3]{z - y}} \cdot \frac{t}{\sqrt[3]{z - y}}} \]
    5. Applied cancel-sign-sub-inv_binary642.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.150743828419859 \cdot 10^{+115} \lor \neg \left(t \leq -3.3018215432180023 \cdot 10^{-248}\right):\\ \;\;\;\;t \cdot \frac{x - y}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot x}{z - y} - \frac{y}{\sqrt[3]{z - y} \cdot \sqrt[3]{z - y}} \cdot \frac{t}{\sqrt[3]{z - y}}\\ \end{array} \]

Reproduce

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