Average Error: 12.0 → 1.9
Time: 17.8s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1085573169033359631560286013061332992 \lor \neg \left(x \le 7.960727031889956501637065450408854649433 \cdot 10^{46}\right):\\ \;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{t - z} + x \cdot \left(-\frac{z}{t - z}\right)\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;x \le -1085573169033359631560286013061332992 \lor \neg \left(x \le 7.960727031889956501637065450408854649433 \cdot 10^{46}\right):\\
\;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{t - z} + x \cdot \left(-\frac{z}{t - z}\right)\\

\end{array}
double f(double x, double y, double z, double t) {
        double r721508 = x;
        double r721509 = y;
        double r721510 = z;
        double r721511 = r721509 - r721510;
        double r721512 = r721508 * r721511;
        double r721513 = t;
        double r721514 = r721513 - r721510;
        double r721515 = r721512 / r721514;
        return r721515;
}

double f(double x, double y, double z, double t) {
        double r721516 = x;
        double r721517 = -1.0855731690333596e+36;
        bool r721518 = r721516 <= r721517;
        double r721519 = 7.960727031889957e+46;
        bool r721520 = r721516 <= r721519;
        double r721521 = !r721520;
        bool r721522 = r721518 || r721521;
        double r721523 = t;
        double r721524 = z;
        double r721525 = r721523 - r721524;
        double r721526 = r721516 / r721525;
        double r721527 = y;
        double r721528 = r721527 - r721524;
        double r721529 = r721526 * r721528;
        double r721530 = r721516 * r721527;
        double r721531 = r721530 / r721525;
        double r721532 = r721524 / r721525;
        double r721533 = -r721532;
        double r721534 = r721516 * r721533;
        double r721535 = r721531 + r721534;
        double r721536 = r721522 ? r721529 : r721535;
        return r721536;
}

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

Original12.0
Target2.0
Herbie1.9
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 2 regimes
  2. if x < -1.0855731690333596e+36 or 7.960727031889957e+46 < x

    1. Initial program 27.2

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity27.2

      \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{1 \cdot \left(t - z\right)}}\]
    4. Applied times-frac2.3

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y - z}{t - z}}\]
    5. Simplified2.3

      \[\leadsto \color{blue}{x} \cdot \frac{y - z}{t - z}\]
    6. Using strategy rm
    7. Applied div-sub2.3

      \[\leadsto x \cdot \color{blue}{\left(\frac{y}{t - z} - \frac{z}{t - z}\right)}\]
    8. Using strategy rm
    9. Applied div-inv2.3

      \[\leadsto x \cdot \left(\frac{y}{t - z} - \color{blue}{z \cdot \frac{1}{t - z}}\right)\]
    10. Applied div-inv2.4

      \[\leadsto x \cdot \left(\color{blue}{y \cdot \frac{1}{t - z}} - z \cdot \frac{1}{t - z}\right)\]
    11. Applied distribute-rgt-out--2.4

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

      \[\leadsto \color{blue}{\left(x \cdot \frac{1}{t - z}\right) \cdot \left(y - z\right)}\]
    13. Simplified3.0

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

    if -1.0855731690333596e+36 < x < 7.960727031889957e+46

    1. Initial program 2.1

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity2.1

      \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{1 \cdot \left(t - z\right)}}\]
    4. Applied times-frac1.8

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y - z}{t - z}}\]
    5. Simplified1.8

      \[\leadsto \color{blue}{x} \cdot \frac{y - z}{t - z}\]
    6. Using strategy rm
    7. Applied div-sub1.8

      \[\leadsto x \cdot \color{blue}{\left(\frac{y}{t - z} - \frac{z}{t - z}\right)}\]
    8. Using strategy rm
    9. Applied sub-neg1.8

      \[\leadsto x \cdot \color{blue}{\left(\frac{y}{t - z} + \left(-\frac{z}{t - z}\right)\right)}\]
    10. Applied distribute-lft-in1.8

      \[\leadsto \color{blue}{x \cdot \frac{y}{t - z} + x \cdot \left(-\frac{z}{t - z}\right)}\]
    11. Using strategy rm
    12. Applied associate-*r/1.2

      \[\leadsto \color{blue}{\frac{x \cdot y}{t - z}} + x \cdot \left(-\frac{z}{t - z}\right)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -1085573169033359631560286013061332992 \lor \neg \left(x \le 7.960727031889956501637065450408854649433 \cdot 10^{46}\right):\\ \;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{t - z} + x \cdot \left(-\frac{z}{t - z}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019209 +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)))