Average Error: 11.4 → 5.0
Time: 8.0s
Precision: 64
Internal Precision: 128
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
\[\begin{array}{l} \mathbf{if}\;a1 \cdot a2 \le -2.090806670510244 \cdot 10^{+115}:\\ \;\;\;\;\frac{a1}{\frac{b2}{\frac{a2}{b1}}}\\ \mathbf{elif}\;a1 \cdot a2 \le -1.317087954560656 \cdot 10^{-224}:\\ \;\;\;\;\frac{\frac{a1 \cdot a2}{b1}}{b2}\\ \mathbf{elif}\;a1 \cdot a2 \le 2.6083144463560513 \cdot 10^{-264}:\\ \;\;\;\;\frac{a2}{b1} \cdot \frac{a1}{b2}\\ \mathbf{elif}\;a1 \cdot a2 \le 8.902833610869096 \cdot 10^{+243}:\\ \;\;\;\;\frac{\frac{a1 \cdot a2}{b1}}{b2}\\ \mathbf{else}:\\ \;\;\;\;\frac{a2}{b1} \cdot \frac{a1}{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.4
Target11.0
Herbie5.0
\[\frac{a1}{b1} \cdot \frac{a2}{b2}\]

Derivation

  1. Split input into 3 regimes
  2. if (* a1 a2) < -2.090806670510244e+115

    1. Initial program 24.1

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Initial simplification11.3

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

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

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

    if -2.090806670510244e+115 < (* a1 a2) < -1.317087954560656e-224 or 2.6083144463560513e-264 < (* a1 a2) < 8.902833610869096e+243

    1. Initial program 4.4

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Initial simplification13.9

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

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

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

    if -1.317087954560656e-224 < (* a1 a2) < 2.6083144463560513e-264 or 8.902833610869096e+243 < (* a1 a2)

    1. Initial program 21.5

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Initial simplification4.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a1 \cdot a2 \le -2.090806670510244 \cdot 10^{+115}:\\ \;\;\;\;\frac{a1}{\frac{b2}{\frac{a2}{b1}}}\\ \mathbf{elif}\;a1 \cdot a2 \le -1.317087954560656 \cdot 10^{-224}:\\ \;\;\;\;\frac{\frac{a1 \cdot a2}{b1}}{b2}\\ \mathbf{elif}\;a1 \cdot a2 \le 2.6083144463560513 \cdot 10^{-264}:\\ \;\;\;\;\frac{a2}{b1} \cdot \frac{a1}{b2}\\ \mathbf{elif}\;a1 \cdot a2 \le 8.902833610869096 \cdot 10^{+243}:\\ \;\;\;\;\frac{\frac{a1 \cdot a2}{b1}}{b2}\\ \mathbf{else}:\\ \;\;\;\;\frac{a2}{b1} \cdot \frac{a1}{b2}\\ \end{array}\]

Runtime

Time bar (total: 8.0s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes11.05.00.011.054.5%
herbie shell --seed 2018353 +o rules:numerics
(FPCore (a1 a2 b1 b2)
  :name "Quotient of products"

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

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