Average Error: 2.1 → 1.9
Time: 12.1s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -5.886890747873425551727597679723315342598 \cdot 10^{-305} \lor \neg \left(y \le 2.653973602534843579162682730306192225397 \cdot 10^{-190}\right):\\ \;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{z - y} \cdot \left(\left(x - y\right) \cdot \sqrt[3]{t}\right)\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -5.886890747873425551727597679723315342598 \cdot 10^{-305} \lor \neg \left(y \le 2.653973602534843579162682730306192225397 \cdot 10^{-190}\right):\\
\;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r265049 = x;
        double r265050 = y;
        double r265051 = r265049 - r265050;
        double r265052 = z;
        double r265053 = r265052 - r265050;
        double r265054 = r265051 / r265053;
        double r265055 = t;
        double r265056 = r265054 * r265055;
        return r265056;
}

double f(double x, double y, double z, double t) {
        double r265057 = y;
        double r265058 = -5.886890747873426e-305;
        bool r265059 = r265057 <= r265058;
        double r265060 = 2.6539736025348436e-190;
        bool r265061 = r265057 <= r265060;
        double r265062 = !r265061;
        bool r265063 = r265059 || r265062;
        double r265064 = x;
        double r265065 = z;
        double r265066 = r265065 - r265057;
        double r265067 = r265064 / r265066;
        double r265068 = r265057 / r265066;
        double r265069 = r265067 - r265068;
        double r265070 = t;
        double r265071 = r265069 * r265070;
        double r265072 = cbrt(r265070);
        double r265073 = r265072 * r265072;
        double r265074 = r265073 / r265066;
        double r265075 = r265064 - r265057;
        double r265076 = r265075 * r265072;
        double r265077 = r265074 * r265076;
        double r265078 = r265063 ? r265071 : r265077;
        return r265078;
}

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
Herbie1.9
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 2 regimes
  2. if y < -5.886890747873426e-305 or 2.6539736025348436e-190 < y

    1. Initial program 1.6

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied div-sub1.6

      \[\leadsto \color{blue}{\left(\frac{x}{z - y} - \frac{y}{z - y}\right)} \cdot t\]

    if -5.886890747873426e-305 < y < 2.6539736025348436e-190

    1. Initial program 7.0

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied clear-num7.2

      \[\leadsto \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \cdot t\]
    4. Using strategy rm
    5. Applied *-un-lft-identity7.2

      \[\leadsto \frac{1}{\color{blue}{1 \cdot \frac{z - y}{x - y}}} \cdot t\]
    6. Applied add-sqr-sqrt7.2

      \[\leadsto \frac{\color{blue}{\sqrt{1} \cdot \sqrt{1}}}{1 \cdot \frac{z - y}{x - y}} \cdot t\]
    7. Applied times-frac7.2

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

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

      \[\leadsto \frac{\sqrt{1}}{1} \cdot \color{blue}{\frac{t}{\frac{z - y}{x - y}}}\]
    10. Using strategy rm
    11. Applied div-inv6.8

      \[\leadsto \frac{\sqrt{1}}{1} \cdot \frac{t}{\color{blue}{\left(z - y\right) \cdot \frac{1}{x - y}}}\]
    12. Applied add-cube-cbrt7.6

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -5.886890747873425551727597679723315342598 \cdot 10^{-305} \lor \neg \left(y \le 2.653973602534843579162682730306192225397 \cdot 10^{-190}\right):\\ \;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{z - y} \cdot \left(\left(x - y\right) \cdot \sqrt[3]{t}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019347 +o rules:numerics
(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))