Average Error: 24.5 → 13.1
Time: 17.4s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -1.488227998811165 \cdot 10^{232}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \mathbf{elif}\;z \le 2.17941341566278614 \cdot 10^{139}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\ \mathbf{elif}\;z \le 3.37471355853467873 \cdot 10^{210}:\\ \;\;\;\;x + \frac{\frac{y - z}{\sqrt[3]{a - z}}}{\sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\begin{array}{l}
\mathbf{if}\;z \le -1.488227998811165 \cdot 10^{232}:\\
\;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\

\mathbf{elif}\;z \le 2.17941341566278614 \cdot 10^{139}:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\

\mathbf{elif}\;z \le 3.37471355853467873 \cdot 10^{210}:\\
\;\;\;\;x + \frac{\frac{y - z}{\sqrt[3]{a - z}}}{\sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r807104 = x;
        double r807105 = y;
        double r807106 = z;
        double r807107 = r807105 - r807106;
        double r807108 = t;
        double r807109 = r807108 - r807104;
        double r807110 = r807107 * r807109;
        double r807111 = a;
        double r807112 = r807111 - r807106;
        double r807113 = r807110 / r807112;
        double r807114 = r807104 + r807113;
        return r807114;
}

double f(double x, double y, double z, double t, double a) {
        double r807115 = z;
        double r807116 = -1.4882279988111647e+232;
        bool r807117 = r807115 <= r807116;
        double r807118 = x;
        double r807119 = y;
        double r807120 = r807118 * r807119;
        double r807121 = r807120 / r807115;
        double r807122 = t;
        double r807123 = r807121 + r807122;
        double r807124 = r807122 * r807119;
        double r807125 = r807124 / r807115;
        double r807126 = r807123 - r807125;
        double r807127 = 2.1794134156627861e+139;
        bool r807128 = r807115 <= r807127;
        double r807129 = r807119 - r807115;
        double r807130 = a;
        double r807131 = r807130 - r807115;
        double r807132 = r807122 - r807118;
        double r807133 = r807131 / r807132;
        double r807134 = r807129 / r807133;
        double r807135 = r807118 + r807134;
        double r807136 = 3.374713558534679e+210;
        bool r807137 = r807115 <= r807136;
        double r807138 = cbrt(r807131);
        double r807139 = r807129 / r807138;
        double r807140 = r807139 / r807138;
        double r807141 = r807132 / r807138;
        double r807142 = r807140 * r807141;
        double r807143 = r807118 + r807142;
        double r807144 = r807137 ? r807143 : r807126;
        double r807145 = r807128 ? r807135 : r807144;
        double r807146 = r807117 ? r807126 : r807145;
        return r807146;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original24.5
Target11.7
Herbie13.1
\[\begin{array}{l} \mathbf{if}\;z \lt -1.25361310560950359 \cdot 10^{188}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \mathbf{elif}\;z \lt 4.44670236911381103 \cdot 10^{64}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if z < -1.4882279988111647e+232 or 3.374713558534679e+210 < z

    1. Initial program 51.7

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
    2. Taylor expanded around inf 24.2

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

    if -1.4882279988111647e+232 < z < 2.1794134156627861e+139

    1. Initial program 17.5

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
    2. Using strategy rm
    3. Applied associate-/l*10.4

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

    if 2.1794134156627861e+139 < z < 3.374713558534679e+210

    1. Initial program 41.9

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt42.2

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity18.2

      \[\leadsto x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{\color{blue}{1 \cdot \left(a - z\right)}}}\]
    7. Applied cbrt-prod18.2

      \[\leadsto x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\color{blue}{\sqrt[3]{1} \cdot \sqrt[3]{a - z}}}\]
    8. Applied *-un-lft-identity18.2

      \[\leadsto x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{\color{blue}{1 \cdot \left(t - x\right)}}{\sqrt[3]{1} \cdot \sqrt[3]{a - z}}\]
    9. Applied times-frac18.2

      \[\leadsto x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \color{blue}{\left(\frac{1}{\sqrt[3]{1}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\right)}\]
    10. Applied associate-*r*18.2

      \[\leadsto x + \color{blue}{\left(\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{1}{\sqrt[3]{1}}\right) \cdot \frac{t - x}{\sqrt[3]{a - z}}}\]
    11. Simplified18.2

      \[\leadsto x + \color{blue}{\frac{\frac{y - z}{\sqrt[3]{a - z}}}{\sqrt[3]{a - z}}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification13.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.488227998811165 \cdot 10^{232}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \mathbf{elif}\;z \le 2.17941341566278614 \cdot 10^{139}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\ \mathbf{elif}\;z \le 3.37471355853467873 \cdot 10^{210}:\\ \;\;\;\;x + \frac{\frac{y - z}{\sqrt[3]{a - z}}}{\sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \end{array}\]

Reproduce

herbie shell --seed 2020047 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (if (< z -1.2536131056095036e+188) (- t (* (/ y z) (- t x))) (if (< z 4.446702369113811e+64) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x)))))

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