Average Error: 1.5 → 0.4
Time: 12.9s
Precision: 64
Internal Precision: 576
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\begin{array}{l} \mathbf{if}\;x \le -3.563448987301963 \cdot 10^{+89}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{x}{y} \cdot z\right|\\ \mathbf{elif}\;x \le 3.620984115508776 \cdot 10^{+83}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{x \cdot z}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{x}{\frac{y}{z}}\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 3 regimes
  2. if x < -3.563448987301963e+89

    1. Initial program 0.1

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

    if -3.563448987301963e+89 < x < 3.620984115508776e+83

    1. Initial program 2.0

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

      \[\leadsto \left|\frac{4 + x}{y} - \frac{x}{\frac{y}{z}}\right|\]
    3. Taylor expanded around -inf 0.5

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

    if 3.620984115508776e+83 < x

    1. Initial program 0.1

      \[\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. Recombined 3 regimes into one program.
  4. Final simplification0.4

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

Runtime

Time bar (total: 12.9s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes1.50.40.01.576.9%
herbie shell --seed 2018285 
(FPCore (x y z)
  :name "fabs fraction 1"
  (fabs (- (/ (+ x 4) y) (* (/ x y) z))))