Average Error: 10.8 → 3.9
Time: 50.9s
Precision: 64
Internal Precision: 576
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
\[\begin{array}{l} \mathbf{if}\;\frac{b2}{a1 \cdot a2} \le -1.863876160696964 \cdot 10^{+274}:\\ \;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\ \mathbf{if}\;\frac{b2}{a1 \cdot a2} \le -4.7730160798000866 \cdot 10^{-170}:\\ \;\;\;\;\frac{1}{\frac{\frac{b2}{a1 \cdot a2}}{\frac{1}{b1}}}\\ \mathbf{if}\;\frac{b2}{a1 \cdot a2} \le 1.1036717243454331 \cdot 10^{-206}:\\ \;\;\;\;\frac{\frac{a1}{\frac{b1}{a2}}}{b2}\\ \mathbf{if}\;\frac{b2}{a1 \cdot a2} \le 3.309194595868243 \cdot 10^{+284}:\\ \;\;\;\;\frac{1}{\frac{\frac{b2}{a1 \cdot a2}}{\frac{1}{b1}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\ \end{array}\]

Error

Bits error versus a1

Bits error versus a2

Bits error versus b1

Bits error versus b2

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.8
Target11.0
Herbie3.9
\[\frac{a1}{b1} \cdot \frac{a2}{b2}\]

Derivation

  1. Split input into 4 regimes
  2. if (/ b2 (* a1 a2)) < -1.863876160696964e+274

    1. Initial program 10.6

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied associate-/l*4.8

      \[\leadsto \color{blue}{\frac{a1}{\frac{b1 \cdot b2}{a2}}}\]

    if -1.863876160696964e+274 < (/ b2 (* a1 a2)) < -4.7730160798000866e-170 or 1.1036717243454331e-206 < (/ b2 (* a1 a2)) < 3.309194595868243e+284

    1. Initial program 7.6

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied associate-/r*7.8

      \[\leadsto \color{blue}{\frac{\frac{a1 \cdot a2}{b1}}{b2}}\]
    4. Using strategy rm
    5. Applied clear-num8.1

      \[\leadsto \color{blue}{\frac{1}{\frac{b2}{\frac{a1 \cdot a2}{b1}}}}\]
    6. Using strategy rm
    7. Applied div-inv8.2

      \[\leadsto \frac{1}{\frac{b2}{\color{blue}{\left(a1 \cdot a2\right) \cdot \frac{1}{b1}}}}\]
    8. Applied associate-/r*1.1

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{b2}{a1 \cdot a2}}{\frac{1}{b1}}}}\]

    if -4.7730160798000866e-170 < (/ b2 (* a1 a2)) < 1.1036717243454331e-206

    1. Initial program 21.7

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied associate-/r*21.8

      \[\leadsto \color{blue}{\frac{\frac{a1 \cdot a2}{b1}}{b2}}\]
    4. Using strategy rm
    5. Applied associate-/l*12.5

      \[\leadsto \frac{\color{blue}{\frac{a1}{\frac{b1}{a2}}}}{b2}\]

    if 3.309194595868243e+284 < (/ b2 (* a1 a2))

    1. Initial program 11.8

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied associate-/l*4.3

      \[\leadsto \color{blue}{\frac{a1}{\frac{b1 \cdot b2}{a2}}}\]
  3. Recombined 4 regimes into one program.

Runtime

Time bar (total: 50.9s)Debug logProfile

herbie shell --seed '#(1072936661 1621281212 3440817831 3219514234 460296804 1258167384)' +o rules:numerics
(FPCore (a1 a2 b1 b2)
  :name "Quotient of products"

  :herbie-target
  (* (/ a1 b1) (/ a2 b2))

  (/ (* a1 a2) (* b1 b2)))