\[\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: 8.5 s
Input Error: 1.6
Output Error: 2.9
Log:
Profile: 🕒
\(\begin{cases} \left|\left(\frac{x}{y} + \frac{4}{y}\right) - \frac{x}{\frac{y}{z}}\right| & \text{when } \frac{x}{y} \cdot z \le -2.719632060198739 \cdot 10^{+107} \\ \left|\frac{\left(x + 4\right) - x \cdot z}{y}\right| & \text{when } \frac{x}{y} \cdot z \le 5.204719037506722 \cdot 10^{+20} \\ \left|\left(\frac{x}{y} + \frac{4}{y}\right) - \frac{x}{\frac{y}{z}}\right| & \text{otherwise} \end{cases}\)

    if (* (/ x y) z) < -2.719632060198739e+107 or 5.204719037506722e+20 < (* (/ x y) z)

    1. Started with
      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
      0.2
    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|\]
      10.8
    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|\]
      10.8
    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|}\]
      9.1

    if -2.719632060198739e+107 < (* (/ x y) z) < 5.204719037506722e+20

    1. Started with
      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
      2.2
    2. Using strategy rm
      2.2
    3. Applied associate-*l/ to get
      \[\left|\frac{x + 4}{y} - \color{red}{\frac{x}{y} \cdot z}\right| \leadsto \left|\frac{x + 4}{y} - \color{blue}{\frac{x \cdot z}{y}}\right|\]
      0.5
    4. Applied sub-div to get
      \[\left|\color{red}{\frac{x + 4}{y} - \frac{x \cdot z}{y}}\right| \leadsto \left|\color{blue}{\frac{\left(x + 4\right) - x \cdot z}{y}}\right|\]
      0.5

  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))))