Average Error: 10.8 → 5.5
Time: 9.4s
Precision: 64
Internal Precision: 576
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
\[\begin{array}{l} \mathbf{if}\;a1 \cdot a2 \le -6.525749460922175 \cdot 10^{+292}:\\ \;\;\;\;\frac{a1}{b2} \cdot \frac{a2}{b1}\\ \mathbf{elif}\;a1 \cdot a2 \le -2.5469560807085005 \cdot 10^{-82}:\\ \;\;\;\;\frac{\frac{a1 \cdot a2}{b1}}{b2}\\ \mathbf{elif}\;a1 \cdot a2 \le 3.160711617003064 \cdot 10^{-169}:\\ \;\;\;\;\frac{a1}{b2} \cdot \frac{a2}{b1}\\ \mathbf{elif}\;a1 \cdot a2 \le 1.1608953560754696 \cdot 10^{+189}:\\ \;\;\;\;\frac{\frac{a1 \cdot a2}{b1}}{b2}\\ \mathbf{else}:\\ \;\;\;\;\frac{a1}{b2} \cdot \frac{a2}{b1}\\ \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
Herbie5.5
\[\frac{a1}{b1} \cdot \frac{a2}{b2}\]

Derivation

  1. Split input into 2 regimes
  2. if (* a1 a2) < -6.525749460922175e+292 or -2.5469560807085005e-82 < (* a1 a2) < 3.160711617003064e-169 or 1.1608953560754696e+189 < (* a1 a2)

    1. Initial program 17.4

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Initial simplification6.7

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

    if -6.525749460922175e+292 < (* a1 a2) < -2.5469560807085005e-82 or 3.160711617003064e-169 < (* a1 a2) < 1.1608953560754696e+189

    1. Initial program 4.2

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Initial simplification14.5

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

      \[\leadsto \color{blue}{\frac{a1 \cdot \frac{a2}{b1}}{b2}}\]
    5. Taylor expanded around -inf 4.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a1 \cdot a2 \le -6.525749460922175 \cdot 10^{+292}:\\ \;\;\;\;\frac{a1}{b2} \cdot \frac{a2}{b1}\\ \mathbf{elif}\;a1 \cdot a2 \le -2.5469560807085005 \cdot 10^{-82}:\\ \;\;\;\;\frac{\frac{a1 \cdot a2}{b1}}{b2}\\ \mathbf{elif}\;a1 \cdot a2 \le 3.160711617003064 \cdot 10^{-169}:\\ \;\;\;\;\frac{a1}{b2} \cdot \frac{a2}{b1}\\ \mathbf{elif}\;a1 \cdot a2 \le 1.1608953560754696 \cdot 10^{+189}:\\ \;\;\;\;\frac{\frac{a1 \cdot a2}{b1}}{b2}\\ \mathbf{else}:\\ \;\;\;\;\frac{a1}{b2} \cdot \frac{a2}{b1}\\ \end{array}\]

Runtime

Time bar (total: 9.4s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes10.75.50.010.648.6%
herbie shell --seed 2018263 
(FPCore (a1 a2 b1 b2)
  :name "Quotient of products"

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

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