Average Error: 11.4 → 2.2
Time: 15.9s
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 r338181 = x;
        double r338182 = y;
        double r338183 = z;
        double r338184 = r338182 - r338183;
        double r338185 = r338181 * r338184;
        double r338186 = t;
        double r338187 = r338186 - r338183;
        double r338188 = r338185 / r338187;
        return r338188;
}

double f(double x, double y, double z, double t) {
        double r338189 = x;
        double r338190 = -1.5118885371134949e+40;
        bool r338191 = r338189 <= r338190;
        double r338192 = t;
        double r338193 = z;
        double r338194 = r338192 - r338193;
        double r338195 = r338189 / r338194;
        double r338196 = 1.0;
        double r338197 = y;
        double r338198 = r338197 - r338193;
        double r338199 = r338196 / r338198;
        double r338200 = r338195 / r338199;
        double r338201 = r338192 / r338198;
        double r338202 = r338193 / r338198;
        double r338203 = r338201 - r338202;
        double r338204 = r338189 / r338203;
        double r338205 = r338191 ? r338200 : r338204;
        return r338205;
}

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 +o rules:numerics
(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)))