Average Error: 10.6 → 2.0
Time: 22.2s
Precision: 64
Internal Precision: 576
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
\[\begin{array}{l} \mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le -1.7807211831365117 \cdot 10^{+308}:\\ \;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\ \mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le -3.7667564838937 \cdot 10^{-319}:\\ \;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\ \mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le 2.6900413964556047 \cdot 10^{-281}:\\ \;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\ \mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le 1.1973690806935057 \cdot 10^{+291}:\\ \;\;\;\;\frac{1}{\frac{b1 \cdot b2}{a1 \cdot a2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{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

Original10.6
Target10.7
Herbie2.0
\[\frac{a1}{b1} \cdot \frac{a2}{b2}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (* a1 a2) (* b1 b2)) < -1.7807211831365117e+308 or -3.7667564838937e-319 < (/ (* a1 a2) (* b1 b2)) < 2.6900413964556047e-281 or 1.1973690806935057e+291 < (/ (* a1 a2) (* b1 b2))

    1. Initial program 23.7

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied times-frac3.6

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

    if -1.7807211831365117e+308 < (/ (* a1 a2) (* b1 b2)) < -3.7667564838937e-319

    1. Initial program 0.8

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]

    if 2.6900413964556047e-281 < (/ (* a1 a2) (* b1 b2)) < 1.1973690806935057e+291

    1. Initial program 0.8

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

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

Runtime

Time bar (total: 22.2s)Debug logProfile

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

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

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