Average Error: 23.2 → 9.2
Time: 36.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 -1.1392530337654849 \cdot 10^{-282}:\\ \;\;\;\;\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}} + x\\ \mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 1.0047143960441098 \cdot 10^{-265}:\\ \;\;\;\;\left(t + \frac{x \cdot y}{z}\right) - \frac{y \cdot t}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{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 -1.1392530337654849 \cdot 10^{-282}:\\
\;\;\;\;\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}} + x\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r29773252 = x;
        double r29773253 = y;
        double r29773254 = z;
        double r29773255 = r29773253 - r29773254;
        double r29773256 = t;
        double r29773257 = r29773256 - r29773252;
        double r29773258 = r29773255 * r29773257;
        double r29773259 = a;
        double r29773260 = r29773259 - r29773254;
        double r29773261 = r29773258 / r29773260;
        double r29773262 = r29773252 + r29773261;
        return r29773262;
}

double f(double x, double y, double z, double t, double a) {
        double r29773263 = x;
        double r29773264 = y;
        double r29773265 = z;
        double r29773266 = r29773264 - r29773265;
        double r29773267 = t;
        double r29773268 = r29773267 - r29773263;
        double r29773269 = r29773266 * r29773268;
        double r29773270 = a;
        double r29773271 = r29773270 - r29773265;
        double r29773272 = r29773269 / r29773271;
        double r29773273 = r29773263 + r29773272;
        double r29773274 = -1.1392530337654849e-282;
        bool r29773275 = r29773273 <= r29773274;
        double r29773276 = cbrt(r29773271);
        double r29773277 = r29773276 * r29773276;
        double r29773278 = r29773266 / r29773277;
        double r29773279 = r29773268 / r29773276;
        double r29773280 = r29773278 * r29773279;
        double r29773281 = r29773280 + r29773263;
        double r29773282 = 1.0047143960441098e-265;
        bool r29773283 = r29773273 <= r29773282;
        double r29773284 = r29773263 * r29773264;
        double r29773285 = r29773284 / r29773265;
        double r29773286 = r29773267 + r29773285;
        double r29773287 = r29773264 * r29773267;
        double r29773288 = r29773287 / r29773265;
        double r29773289 = r29773286 - r29773288;
        double r29773290 = r29773283 ? r29773289 : r29773281;
        double r29773291 = r29773275 ? r29773281 : r29773290;
        return r29773291;
}

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.2
Target11.8
Herbie9.2
\[\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 (+ x (/ (* (- y z) (- t x)) (- a z))) < -1.1392530337654849e-282 or 1.0047143960441098e-265 < (+ x (/ (* (- y z) (- t x)) (- a z)))

    1. Initial program 19.8

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt20.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-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 -1.1392530337654849e-282 < (+ x (/ (* (- y z) (- t x)) (- a z))) < 1.0047143960441098e-265

    1. Initial program 55.3

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

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

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

Reproduce

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