Average Error: 1.6 → 1.8
Time: 22.7s
Precision: 64
Internal Precision: 576
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\begin{array}{l} \mathbf{if}\;y \le -5.295443062842791 \cdot 10^{+25}:\\ \;\;\;\;\left|\frac{4 + x}{y} - x \cdot \frac{z}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{z \cdot x}{y}\right|\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if y < -5.295443062842791e+25

    1. Initial program 2.4

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
    2. Initial simplification0.1

      \[\leadsto \left|\frac{4 + x}{y} - \frac{x}{\frac{y}{z}}\right|\]
    3. Using strategy rm
    4. Applied div-inv0.2

      \[\leadsto \left|\frac{4 + x}{y} - \color{blue}{x \cdot \frac{1}{\frac{y}{z}}}\right|\]
    5. Taylor expanded around -inf 0.1

      \[\leadsto \left|\frac{4 + x}{y} - x \cdot \color{blue}{\frac{z}{y}}\right|\]

    if -5.295443062842791e+25 < y

    1. Initial program 1.2

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
    2. Initial simplification3.9

      \[\leadsto \left|\frac{4 + x}{y} - \frac{x}{\frac{y}{z}}\right|\]
    3. Using strategy rm
    4. Applied div-inv4.4

      \[\leadsto \left|\frac{4 + x}{y} - \color{blue}{x \cdot \frac{1}{\frac{y}{z}}}\right|\]
    5. Taylor expanded around -inf 4.4

      \[\leadsto \left|\frac{4 + x}{y} - x \cdot \color{blue}{\frac{z}{y}}\right|\]
    6. Using strategy rm
    7. Applied associate-*r/2.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -5.295443062842791 \cdot 10^{+25}:\\ \;\;\;\;\left|\frac{4 + x}{y} - x \cdot \frac{z}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{z \cdot x}{y}\right|\\ \end{array}\]

Runtime

Time bar (total: 22.7s)Debug logProfile

herbie shell --seed 2018256 +o rules:numerics
(FPCore (x y z)
  :name "fabs fraction 1"
  (fabs (- (/ (+ x 4) y) (* (/ x y) z))))