Average Error: 11.4 → 2.2
Time: 12.2s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;x \le -15118885371134948671347587713236746633220:\\ \;\;\;\;\frac{\frac{x}{t - z}}{\frac{1}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;x \le -15118885371134948671347587713236746633220:\\
\;\;\;\;\frac{\frac{x}{t - z}}{\frac{1}{y - z}}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r402728 = x;
        double r402729 = y;
        double r402730 = z;
        double r402731 = r402729 - r402730;
        double r402732 = r402728 * r402731;
        double r402733 = t;
        double r402734 = r402733 - r402730;
        double r402735 = r402732 / r402734;
        return r402735;
}

double f(double x, double y, double z, double t) {
        double r402736 = x;
        double r402737 = -1.5118885371134949e+40;
        bool r402738 = r402736 <= r402737;
        double r402739 = t;
        double r402740 = z;
        double r402741 = r402739 - r402740;
        double r402742 = r402736 / r402741;
        double r402743 = 1.0;
        double r402744 = y;
        double r402745 = r402744 - r402740;
        double r402746 = r402743 / r402745;
        double r402747 = r402742 / r402746;
        double r402748 = r402739 / r402745;
        double r402749 = r402740 / r402745;
        double r402750 = r402748 - r402749;
        double r402751 = r402736 / r402750;
        double r402752 = r402738 ? r402747 : r402751;
        return r402752;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original11.4
Target2.2
Herbie2.2
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 2 regimes
  2. if x < -1.5118885371134949e+40

    1. Initial program 25.8

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied associate-/l*3.2

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}}\]
    4. Using strategy rm
    5. Applied div-inv3.4

      \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot \frac{1}{y - z}}}\]
    6. Applied associate-/r*3.3

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{\frac{1}{y - z}}}\]

    if -1.5118885371134949e+40 < x

    1. Initial program 7.9

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied associate-/l*2.0

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}}\]
    4. Using strategy rm
    5. Applied div-sub2.0

      \[\leadsto \frac{x}{\color{blue}{\frac{t}{y - z} - \frac{z}{y - z}}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification2.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -15118885371134948671347587713236746633220:\\ \;\;\;\;\frac{\frac{x}{t - z}}{\frac{1}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019325 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (/ x (/ (- t z) (- y z)))

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