Average Error: 24.5 → 12.9
Time: 27.7s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -7.741588738047601581026050342874170834939 \cdot 10^{-191} \lor \neg \left(a \le 1.281345112742519088807325435547038268021 \cdot 10^{-180} \lor \neg \left(a \le 5.63612246809579092619950315438451488554 \cdot 10^{-130}\right) \land a \le 1.412555036293380759747291185214939704785 \cdot 10^{-72}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{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.741588738047601581026050342874170834939 \cdot 10^{-191} \lor \neg \left(a \le 1.281345112742519088807325435547038268021 \cdot 10^{-180} \lor \neg \left(a \le 5.63612246809579092619950315438451488554 \cdot 10^{-130}\right) \land a \le 1.412555036293380759747291185214939704785 \cdot 10^{-72}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{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 r434079 = x;
        double r434080 = y;
        double r434081 = z;
        double r434082 = r434080 - r434081;
        double r434083 = t;
        double r434084 = r434083 - r434079;
        double r434085 = r434082 * r434084;
        double r434086 = a;
        double r434087 = r434086 - r434081;
        double r434088 = r434085 / r434087;
        double r434089 = r434079 + r434088;
        return r434089;
}

double f(double x, double y, double z, double t, double a) {
        double r434090 = a;
        double r434091 = -7.741588738047602e-191;
        bool r434092 = r434090 <= r434091;
        double r434093 = 1.281345112742519e-180;
        bool r434094 = r434090 <= r434093;
        double r434095 = 5.636122468095791e-130;
        bool r434096 = r434090 <= r434095;
        double r434097 = !r434096;
        double r434098 = 1.4125550362933808e-72;
        bool r434099 = r434090 <= r434098;
        bool r434100 = r434097 && r434099;
        bool r434101 = r434094 || r434100;
        double r434102 = !r434101;
        bool r434103 = r434092 || r434102;
        double r434104 = x;
        double r434105 = y;
        double r434106 = z;
        double r434107 = r434105 - r434106;
        double r434108 = t;
        double r434109 = r434108 - r434104;
        double r434110 = r434090 - r434106;
        double r434111 = r434109 / r434110;
        double r434112 = r434107 * r434111;
        double r434113 = r434104 + r434112;
        double r434114 = r434104 * r434105;
        double r434115 = r434114 / r434106;
        double r434116 = r434115 + r434108;
        double r434117 = r434108 * r434105;
        double r434118 = r434117 / r434106;
        double r434119 = r434116 - r434118;
        double r434120 = r434103 ? r434113 : r434119;
        return r434120;
}

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
Target12.2
Herbie12.9
\[\begin{array}{l} \mathbf{if}\;z \lt -1.253613105609503593846459977496550767343 \cdot 10^{188}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \mathbf{elif}\;z \lt 4.446702369113811028051510715777703865332 \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.741588738047602e-191 or 1.281345112742519e-180 < a < 5.636122468095791e-130 or 1.4125550362933808e-72 < a

    1. Initial program 23.6

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity23.6

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

      \[\leadsto x + \color{blue}{\frac{y - z}{1} \cdot \frac{t - x}{a - z}}\]
    5. Simplified12.3

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

    if -7.741588738047602e-191 < a < 1.281345112742519e-180 or 5.636122468095791e-130 < a < 1.4125550362933808e-72

    1. Initial program 27.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -7.741588738047601581026050342874170834939 \cdot 10^{-191} \lor \neg \left(a \le 1.281345112742519088807325435547038268021 \cdot 10^{-180} \lor \neg \left(a \le 5.63612246809579092619950315438451488554 \cdot 10^{-130}\right) \land a \le 1.412555036293380759747291185214939704785 \cdot 10^{-72}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \end{array}\]

Reproduce

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