Average Error: 25.1 → 10.9
Time: 8.5s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -8.741731478203489932433786908162679076106 \cdot 10^{-201} \lor \neg \left(a \le 3.17759089387443058571350167291573822101 \cdot 10^{-128}\right):\\ \;\;\;\;x + \frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \left(\frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\right)\\ \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 -8.741731478203489932433786908162679076106 \cdot 10^{-201} \lor \neg \left(a \le 3.17759089387443058571350167291573822101 \cdot 10^{-128}\right):\\
\;\;\;\;x + \frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \left(\frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\right)\\

\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 r580874 = x;
        double r580875 = y;
        double r580876 = z;
        double r580877 = r580875 - r580876;
        double r580878 = t;
        double r580879 = r580878 - r580874;
        double r580880 = r580877 * r580879;
        double r580881 = a;
        double r580882 = r580881 - r580876;
        double r580883 = r580880 / r580882;
        double r580884 = r580874 + r580883;
        return r580884;
}

double f(double x, double y, double z, double t, double a) {
        double r580885 = a;
        double r580886 = -8.74173147820349e-201;
        bool r580887 = r580885 <= r580886;
        double r580888 = 3.1775908938744306e-128;
        bool r580889 = r580885 <= r580888;
        double r580890 = !r580889;
        bool r580891 = r580887 || r580890;
        double r580892 = x;
        double r580893 = y;
        double r580894 = z;
        double r580895 = r580893 - r580894;
        double r580896 = cbrt(r580895);
        double r580897 = r580896 * r580896;
        double r580898 = r580885 - r580894;
        double r580899 = cbrt(r580898);
        double r580900 = r580897 / r580899;
        double r580901 = r580896 / r580899;
        double r580902 = t;
        double r580903 = r580902 - r580892;
        double r580904 = r580903 / r580899;
        double r580905 = r580901 * r580904;
        double r580906 = r580900 * r580905;
        double r580907 = r580892 + r580906;
        double r580908 = r580892 * r580893;
        double r580909 = r580908 / r580894;
        double r580910 = r580909 + r580902;
        double r580911 = r580902 * r580893;
        double r580912 = r580911 / r580894;
        double r580913 = r580910 - r580912;
        double r580914 = r580891 ? r580907 : r580913;
        return r580914;
}

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

Original25.1
Target11.8
Herbie10.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 < -8.74173147820349e-201 or 3.1775908938744306e-128 < a

    1. Initial program 23.8

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

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

      \[\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 add-cube-cbrt10.6

      \[\leadsto x + \frac{\color{blue}{\left(\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}\right) \cdot \sqrt[3]{y - z}}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\]
    7. Applied times-frac10.6

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

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

    if -8.74173147820349e-201 < a < 3.1775908938744306e-128

    1. Initial program 30.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -8.741731478203489932433786908162679076106 \cdot 10^{-201} \lor \neg \left(a \le 3.17759089387443058571350167291573822101 \cdot 10^{-128}\right):\\ \;\;\;\;x + \frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \left(\frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \end{array}\]

Reproduce

herbie shell --seed 2019322 
(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.25361310560950359e188) (- t (* (/ y z) (- t x))) (if (< z 4.44670236911381103e64) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x)))))

  (+ x (/ (* (- y z) (- t x)) (- a z))))