Average Error: 24.5 → 11.8
Time: 7.8s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -7.3755603769615804 \cdot 10^{-35} \lor \neg \left(a \le 1.9004176779287355 \cdot 10^{-73}\right):\\ \;\;\;\;x + \frac{y - z}{\sqrt[3]{a - z} \cdot \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}\;a \le -7.3755603769615804 \cdot 10^{-35} \lor \neg \left(a \le 1.9004176779287355 \cdot 10^{-73}\right):\\
\;\;\;\;x + \frac{y - z}{\sqrt[3]{a - z} \cdot \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 r751156 = x;
        double r751157 = y;
        double r751158 = z;
        double r751159 = r751157 - r751158;
        double r751160 = t;
        double r751161 = r751160 - r751156;
        double r751162 = r751159 * r751161;
        double r751163 = a;
        double r751164 = r751163 - r751158;
        double r751165 = r751162 / r751164;
        double r751166 = r751156 + r751165;
        return r751166;
}

double f(double x, double y, double z, double t, double a) {
        double r751167 = a;
        double r751168 = -7.37556037696158e-35;
        bool r751169 = r751167 <= r751168;
        double r751170 = 1.9004176779287355e-73;
        bool r751171 = r751167 <= r751170;
        double r751172 = !r751171;
        bool r751173 = r751169 || r751172;
        double r751174 = x;
        double r751175 = y;
        double r751176 = z;
        double r751177 = r751175 - r751176;
        double r751178 = r751167 - r751176;
        double r751179 = cbrt(r751178);
        double r751180 = r751179 * r751179;
        double r751181 = r751177 / r751180;
        double r751182 = t;
        double r751183 = r751182 - r751174;
        double r751184 = r751183 / r751179;
        double r751185 = r751181 * r751184;
        double r751186 = r751174 + r751185;
        double r751187 = r751174 * r751175;
        double r751188 = r751187 / r751176;
        double r751189 = r751188 + r751182;
        double r751190 = r751182 * r751175;
        double r751191 = r751190 / r751176;
        double r751192 = r751189 - r751191;
        double r751193 = r751173 ? r751186 : r751192;
        return r751193;
}

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.8
Herbie11.8
\[\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 2 regimes
  2. if a < -7.37556037696158e-35 or 1.9004176779287355e-73 < a

    1. Initial program 22.1

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

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

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

    if -7.37556037696158e-35 < a < 1.9004176779287355e-73

    1. Initial program 28.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -7.3755603769615804 \cdot 10^{-35} \lor \neg \left(a \le 1.9004176779287355 \cdot 10^{-73}\right):\\ \;\;\;\;x + \frac{y - z}{\sqrt[3]{a - z} \cdot \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 2020027 
(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))))