\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
Test:
fabs fraction 1
Bits:
128 bits
Bits error versus x
Bits error versus y
Bits error versus z
Time: 7.5 s
Input Error: 1.7
Output Error: 0.2
Log:
Profile: 🕒
\(\begin{cases} \left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| & \text{when } \frac{x}{y} \cdot z \le -8.117423554551543 \cdot 10^{+85} \\ \left|\left(\frac{x}{y} + \frac{4}{y}\right) - \frac{x}{\frac{y}{z}}\right| & \text{when } \frac{x}{y} \cdot z \le 9.360847483081378 \cdot 10^{-47} \\ \left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| & \text{otherwise} \end{cases}\)

    if (* (/ x y) z) < -8.117423554551543e+85 or 9.360847483081378e-47 < (* (/ x y) z)

    1. Started with
      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
      0.2

    if -8.117423554551543e+85 < (* (/ x y) z) < 9.360847483081378e-47

    1. Started with
      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
      2.4
    2. Applied taylor to get
      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \leadsto \left|\left(\frac{x}{y} + 4 \cdot \frac{1}{y}\right) - \frac{x \cdot z}{y}\right|\]
      0.4
    3. Taylor expanded around 0 to get
      \[\left|\color{red}{\left(\frac{x}{y} + 4 \cdot \frac{1}{y}\right) - \frac{x \cdot z}{y}}\right| \leadsto \left|\color{blue}{\left(\frac{x}{y} + 4 \cdot \frac{1}{y}\right) - \frac{x \cdot z}{y}}\right|\]
      0.4
    4. Applied simplify to get
      \[\color{red}{\left|\left(\frac{x}{y} + 4 \cdot \frac{1}{y}\right) - \frac{x \cdot z}{y}\right|} \leadsto \color{blue}{\left|\left(\frac{x}{y} + \frac{4}{y}\right) - \frac{x}{\frac{y}{z}}\right|}\]
      0.2

  1. Removed slow pow expressions

Original test:


(lambda ((x default) (y default) (z default))
  #:name "fabs fraction 1"
  (fabs (- (/ (+ x 4) y) (* (/ x y) z))))