Average Error: 23.8 → 9.7
Time: 21.2s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -3.4167661692054223 \cdot 10^{-133}:\\ \;\;\;\;\frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} \cdot \frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}} + x\\ \mathbf{elif}\;a \le 1.3917837591469568 \cdot 10^{-93}:\\ \;\;\;\;y \cdot \left(\frac{x}{z} - \frac{t}{z}\right) + t\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} \cdot \frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}} + x\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le -3.4167661692054223 \cdot 10^{-133}:\\
\;\;\;\;\frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} \cdot \frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}} + x\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r31089257 = x;
        double r31089258 = y;
        double r31089259 = z;
        double r31089260 = r31089258 - r31089259;
        double r31089261 = t;
        double r31089262 = r31089261 - r31089257;
        double r31089263 = r31089260 * r31089262;
        double r31089264 = a;
        double r31089265 = r31089264 - r31089259;
        double r31089266 = r31089263 / r31089265;
        double r31089267 = r31089257 + r31089266;
        return r31089267;
}

double f(double x, double y, double z, double t, double a) {
        double r31089268 = a;
        double r31089269 = -3.4167661692054223e-133;
        bool r31089270 = r31089268 <= r31089269;
        double r31089271 = t;
        double r31089272 = x;
        double r31089273 = r31089271 - r31089272;
        double r31089274 = cbrt(r31089273);
        double r31089275 = z;
        double r31089276 = r31089268 - r31089275;
        double r31089277 = cbrt(r31089276);
        double r31089278 = r31089274 / r31089277;
        double r31089279 = y;
        double r31089280 = r31089279 - r31089275;
        double r31089281 = r31089277 / r31089274;
        double r31089282 = r31089281 * r31089281;
        double r31089283 = r31089280 / r31089282;
        double r31089284 = r31089278 * r31089283;
        double r31089285 = r31089284 + r31089272;
        double r31089286 = 1.3917837591469568e-93;
        bool r31089287 = r31089268 <= r31089286;
        double r31089288 = r31089272 / r31089275;
        double r31089289 = r31089271 / r31089275;
        double r31089290 = r31089288 - r31089289;
        double r31089291 = r31089279 * r31089290;
        double r31089292 = r31089291 + r31089271;
        double r31089293 = r31089287 ? r31089292 : r31089285;
        double r31089294 = r31089270 ? r31089285 : r31089293;
        return r31089294;
}

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

Original23.8
Target11.9
Herbie9.7
\[\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 2 regimes
  2. if a < -3.4167661692054223e-133 or 1.3917837591469568e-93 < a

    1. Initial program 21.5

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

      \[\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.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-identity9.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-prod9.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 add-cube-cbrt9.4

      \[\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.4

      \[\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.9

      \[\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. Simplified9.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}}\]

    if -3.4167661692054223e-133 < a < 1.3917837591469568e-93

    1. Initial program 29.7

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

      \[\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-frac21.6

      \[\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-identity21.6

      \[\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-prod21.6

      \[\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-cbrt21.8

      \[\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-frac21.8

      \[\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*20.8

      \[\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. Simplified20.7

      \[\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. Taylor expanded around inf 14.3

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

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

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

Reproduce

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