Average Error: 1.7 → 0.3
Time: 11.1s
Precision: 64
Internal Precision: 128
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\begin{array}{l} \mathbf{if}\;x \le -2.58205319147812 \cdot 10^{+70} \lor \neg \left(x \le 6.759328371678758 \cdot 10^{-78}\right):\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{x}{y} \cdot z\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\left(4 + x\right) - x \cdot z}{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 x < -2.58205319147812e+70 or 6.759328371678758e-78 < x

    1. Initial program 0.4

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

      \[\leadsto \left|\frac{4 + x}{y} - \frac{x}{\frac{y}{z}}\right|\]
    3. Using strategy rm
    4. Applied associate-/r/0.4

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

    if -2.58205319147812e+70 < x < 6.759328371678758e-78

    1. Initial program 2.6

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

      \[\leadsto \left|\frac{4 + x}{y} - \frac{x}{\frac{y}{z}}\right|\]
    3. Using strategy rm
    4. Applied associate-/r/2.6

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

      \[\leadsto \left|\frac{4 + x}{y} - \color{blue}{\frac{x \cdot z}{y}}\right|\]
    7. Applied sub-div0.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -2.58205319147812 \cdot 10^{+70} \lor \neg \left(x \le 6.759328371678758 \cdot 10^{-78}\right):\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{x}{y} \cdot z\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|\\ \end{array}\]

Runtime

Time bar (total: 11.1s)Debug logProfile

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