Average Error: 24.2 → 9.9
Time: 21.9s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -2.335375383468043 \cdot 10^{-253}:\\ \;\;\;\;\left(\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right)\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} + x\\ \mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 4.422650758851032 \cdot 10^{-257}:\\ \;\;\;\;\left(t + \frac{x \cdot y}{z}\right) - \frac{y \cdot t}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\frac{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}{\sqrt[3]{y - z}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} + x\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -2.335375383468043 \cdot 10^{-253}:\\
\;\;\;\;\left(\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right)\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} + x\\

\mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 4.422650758851032 \cdot 10^{-257}:\\
\;\;\;\;\left(t + \frac{x \cdot y}{z}\right) - \frac{y \cdot t}{z}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\frac{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}{\sqrt[3]{y - z}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} + x\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r32896132 = x;
        double r32896133 = y;
        double r32896134 = z;
        double r32896135 = r32896133 - r32896134;
        double r32896136 = t;
        double r32896137 = r32896136 - r32896132;
        double r32896138 = r32896135 * r32896137;
        double r32896139 = a;
        double r32896140 = r32896139 - r32896134;
        double r32896141 = r32896138 / r32896140;
        double r32896142 = r32896132 + r32896141;
        return r32896142;
}

double f(double x, double y, double z, double t, double a) {
        double r32896143 = x;
        double r32896144 = y;
        double r32896145 = z;
        double r32896146 = r32896144 - r32896145;
        double r32896147 = t;
        double r32896148 = r32896147 - r32896143;
        double r32896149 = r32896146 * r32896148;
        double r32896150 = a;
        double r32896151 = r32896150 - r32896145;
        double r32896152 = r32896149 / r32896151;
        double r32896153 = r32896143 + r32896152;
        double r32896154 = -2.335375383468043e-253;
        bool r32896155 = r32896153 <= r32896154;
        double r32896156 = cbrt(r32896151);
        double r32896157 = r32896156 * r32896156;
        double r32896158 = r32896146 / r32896157;
        double r32896159 = cbrt(r32896148);
        double r32896160 = r32896159 * r32896159;
        double r32896161 = r32896158 * r32896160;
        double r32896162 = r32896159 / r32896156;
        double r32896163 = r32896161 * r32896162;
        double r32896164 = r32896163 + r32896143;
        double r32896165 = 4.422650758851032e-257;
        bool r32896166 = r32896153 <= r32896165;
        double r32896167 = r32896143 * r32896144;
        double r32896168 = r32896167 / r32896145;
        double r32896169 = r32896147 + r32896168;
        double r32896170 = r32896144 * r32896147;
        double r32896171 = r32896170 / r32896145;
        double r32896172 = r32896169 - r32896171;
        double r32896173 = cbrt(r32896146);
        double r32896174 = r32896173 * r32896173;
        double r32896175 = r32896156 / r32896159;
        double r32896176 = r32896175 * r32896175;
        double r32896177 = r32896176 / r32896173;
        double r32896178 = r32896174 / r32896177;
        double r32896179 = r32896178 * r32896162;
        double r32896180 = r32896179 + r32896143;
        double r32896181 = r32896166 ? r32896172 : r32896180;
        double r32896182 = r32896155 ? r32896164 : r32896181;
        return r32896182;
}

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.2
Target12.2
Herbie9.9
\[\begin{array}{l} \mathbf{if}\;z \lt -1.2536131056095036 \cdot 10^{+188}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \mathbf{elif}\;z \lt 4.446702369113811 \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 (+ x (/ (* (- y z) (- t x)) (- a z))) < -2.335375383468043e-253

    1. Initial program 21.0

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt21.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.3

      \[\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-identity8.3

      \[\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-prod8.3

      \[\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 add-cube-cbrt8.5

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

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\]
    12. Using strategy rm
    13. Applied frac-times8.1

      \[\leadsto x + \frac{y - z}{\color{blue}{\frac{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\]
    14. Applied associate-/r/8.1

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

    if -2.335375383468043e-253 < (+ x (/ (* (- y z) (- t x)) (- a z))) < 4.422650758851032e-257

    1. Initial program 52.4

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

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

    if 4.422650758851032e-257 < (+ x (/ (* (- y z) (- t x)) (- a z)))

    1. Initial program 21.6

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

      \[\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-frac9.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}}}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity9.0

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

      \[\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 add-cube-cbrt9.2

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

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\]
    12. Using strategy rm
    13. Applied add-cube-cbrt8.6

      \[\leadsto x + \frac{\color{blue}{\left(\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}\right) \cdot \sqrt[3]{y - z}}}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\]
    14. Applied associate-/l*8.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -2.335375383468043 \cdot 10^{-253}:\\ \;\;\;\;\left(\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right)\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} + x\\ \mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 4.422650758851032 \cdot 10^{-257}:\\ \;\;\;\;\left(t + \frac{x \cdot y}{z}\right) - \frac{y \cdot t}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\frac{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}{\sqrt[3]{y - z}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} + x\\ \end{array}\]

Reproduce

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

  :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))))