Average Error: 23.5 → 12.5
Time: 17.0s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -2.5697361957571348 \cdot 10^{-281}:\\ \;\;\;\;\left(\left(\frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} \cdot \left(-z\right)\right) \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} + x\right) + \left(\frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} \cdot y\right) \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}\\ \mathbf{elif}\;a \le 1.4479831597119774 \cdot 10^{-263}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} \cdot \left(-z\right)\right) \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} + x\right) + \left(\frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} \cdot y\right) \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le -2.5697361957571348 \cdot 10^{-281}:\\
\;\;\;\;\left(\left(\frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} \cdot \left(-z\right)\right) \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} + x\right) + \left(\frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} \cdot y\right) \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}\\

\mathbf{elif}\;a \le 1.4479831597119774 \cdot 10^{-263}:\\
\;\;\;\;t\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r11091865 = x;
        double r11091866 = y;
        double r11091867 = z;
        double r11091868 = r11091866 - r11091867;
        double r11091869 = t;
        double r11091870 = r11091869 - r11091865;
        double r11091871 = r11091868 * r11091870;
        double r11091872 = a;
        double r11091873 = r11091872 - r11091867;
        double r11091874 = r11091871 / r11091873;
        double r11091875 = r11091865 + r11091874;
        return r11091875;
}

double f(double x, double y, double z, double t, double a) {
        double r11091876 = a;
        double r11091877 = -2.5697361957571348e-281;
        bool r11091878 = r11091876 <= r11091877;
        double r11091879 = t;
        double r11091880 = x;
        double r11091881 = r11091879 - r11091880;
        double r11091882 = cbrt(r11091881);
        double r11091883 = z;
        double r11091884 = r11091876 - r11091883;
        double r11091885 = cbrt(r11091884);
        double r11091886 = r11091882 / r11091885;
        double r11091887 = -r11091883;
        double r11091888 = r11091886 * r11091887;
        double r11091889 = r11091882 * r11091882;
        double r11091890 = r11091885 * r11091885;
        double r11091891 = r11091889 / r11091890;
        double r11091892 = r11091888 * r11091891;
        double r11091893 = r11091892 + r11091880;
        double r11091894 = y;
        double r11091895 = r11091886 * r11091894;
        double r11091896 = r11091895 * r11091891;
        double r11091897 = r11091893 + r11091896;
        double r11091898 = 1.4479831597119774e-263;
        bool r11091899 = r11091876 <= r11091898;
        double r11091900 = r11091899 ? r11091879 : r11091897;
        double r11091901 = r11091878 ? r11091897 : r11091900;
        return r11091901;
}

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.5
Target11.5
Herbie12.5
\[\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 < -2.5697361957571348e-281 or 1.4479831597119774e-263 < a

    1. Initial program 23.1

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
    2. Simplified14.3

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)}\]
    3. Using strategy rm
    4. Applied fma-udef14.3

      \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(y - z\right) + x}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt14.9

      \[\leadsto \frac{t - x}{\color{blue}{\left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right) \cdot \sqrt[3]{a - z}}} \cdot \left(y - z\right) + x\]
    7. Applied add-cube-cbrt15.0

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

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \left(\frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} \cdot \left(y - z\right)\right)} + x\]
    10. Using strategy rm
    11. Applied sub-neg11.9

      \[\leadsto \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \left(\frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} \cdot \color{blue}{\left(y + \left(-z\right)\right)}\right) + x\]
    12. Applied distribute-rgt-in11.9

      \[\leadsto \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \color{blue}{\left(y \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}} + \left(-z\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\right)} + x\]
    13. Applied distribute-lft-in11.9

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

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

    if -2.5697361957571348e-281 < a < 1.4479831597119774e-263

    1. Initial program 30.5

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
    2. Simplified25.2

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)}\]
    3. Taylor expanded around 0 29.0

      \[\leadsto \color{blue}{t}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification12.5

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

Reproduce

herbie shell --seed 2019156 +o rules:numerics
(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))))