Average Error: 11.1 → 2.9
Time: 40.5s
Precision: 64
Internal Precision: 576
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\frac{b1 \cdot b2}{a1}}{a2} \le -1.6951281669341966 \cdot 10^{+302}:\\ \;\;\;\;\frac{\frac{a1}{\frac{b1}{a2}}}{b2}\\ \mathbf{if}\;\frac{\frac{b1 \cdot b2}{a1}}{a2} \le -5.324150171986738 \cdot 10^{-256}:\\ \;\;\;\;\frac{1}{\frac{\frac{b1 \cdot b2}{a1}}{a2}}\\ \mathbf{if}\;\frac{\frac{b1 \cdot b2}{a1}}{a2} \le 1.4509427417667148 \cdot 10^{-298}:\\ \;\;\;\;\frac{\frac{a1}{\frac{b1}{a2}}}{b2}\\ \mathbf{if}\;\frac{\frac{b1 \cdot b2}{a1}}{a2} \le 4.406970769445578 \cdot 10^{+306}:\\ \;\;\;\;\frac{1}{\frac{\frac{b1 \cdot b2}{a1}}{a2}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{a1 \cdot a2}{b1}}{b2}} \cdot \sqrt{\frac{\frac{a1 \cdot a2}{b1}}{b2}}\\ \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

Original11.1
Target11.0
Herbie2.9
\[\frac{a1}{b1} \cdot \frac{a2}{b2}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (/ (* b1 b2) a1) a2) < -1.6951281669341966e+302 or -5.324150171986738e-256 < (/ (/ (* b1 b2) a1) a2) < 1.4509427417667148e-298

    1. Initial program 18.7

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

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

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

    if -1.6951281669341966e+302 < (/ (/ (* b1 b2) a1) a2) < -5.324150171986738e-256 or 1.4509427417667148e-298 < (/ (/ (* b1 b2) a1) a2) < 4.406970769445578e+306

    1. Initial program 7.2

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied clear-num7.3

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

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

    if 4.406970769445578e+306 < (/ (/ (* b1 b2) a1) a2)

    1. Initial program 11.3

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

      \[\leadsto \color{blue}{\frac{\frac{a1 \cdot a2}{b1}}{b2}}\]
    4. Using strategy rm
    5. Applied add-sqr-sqrt4.8

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

Runtime

Time bar (total: 40.5s)Debug logProfile

herbie shell --seed 2018214 +o rules:numerics
(FPCore (a1 a2 b1 b2)
  :name "Quotient of products"

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

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