Average Error: 24.5 → 12.9
Time: 27.9s
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 r382682 = x;
        double r382683 = y;
        double r382684 = z;
        double r382685 = r382683 - r382684;
        double r382686 = t;
        double r382687 = r382686 - r382682;
        double r382688 = r382685 * r382687;
        double r382689 = a;
        double r382690 = r382689 - r382684;
        double r382691 = r382688 / r382690;
        double r382692 = r382682 + r382691;
        return r382692;
}

double f(double x, double y, double z, double t, double a) {
        double r382693 = a;
        double r382694 = -7.741588738047602e-191;
        bool r382695 = r382693 <= r382694;
        double r382696 = 1.281345112742519e-180;
        bool r382697 = r382693 <= r382696;
        double r382698 = 5.636122468095791e-130;
        bool r382699 = r382693 <= r382698;
        double r382700 = !r382699;
        double r382701 = 1.4125550362933808e-72;
        bool r382702 = r382693 <= r382701;
        bool r382703 = r382700 && r382702;
        bool r382704 = r382697 || r382703;
        double r382705 = !r382704;
        bool r382706 = r382695 || r382705;
        double r382707 = x;
        double r382708 = y;
        double r382709 = z;
        double r382710 = r382708 - r382709;
        double r382711 = t;
        double r382712 = r382711 - r382707;
        double r382713 = r382693 - r382709;
        double r382714 = r382712 / r382713;
        double r382715 = r382710 * r382714;
        double r382716 = r382707 + r382715;
        double r382717 = r382707 * r382708;
        double r382718 = r382717 / r382709;
        double r382719 = r382718 + r382711;
        double r382720 = r382711 * r382708;
        double r382721 = r382720 / r382709;
        double r382722 = r382719 - r382721;
        double r382723 = r382706 ? r382716 : r382722;
        return r382723;
}

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