Average Error: 14.1 → 3.1
Time: 4.8s
Precision: 64
Internal Precision: 576
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le 4.279263918164063 \cdot 10^{-295}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;\frac{y}{z} \le 4.999939969196146 \cdot 10^{+208}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (/ y z) < 4.279263918164063e-295 or 4.999939969196146e+208 < (/ y z)

    1. Initial program 17.3

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Initial simplification4.7

      \[\leadsto y \cdot \frac{x}{z}\]
    3. Using strategy rm
    4. Applied associate-*r/4.5

      \[\leadsto \color{blue}{\frac{y \cdot x}{z}}\]
    5. Using strategy rm
    6. Applied associate-/l*4.7

      \[\leadsto \color{blue}{\frac{y}{\frac{z}{x}}}\]

    if 4.279263918164063e-295 < (/ y z) < 4.999939969196146e+208

    1. Initial program 8.4

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Initial simplification8.2

      \[\leadsto y \cdot \frac{x}{z}\]
    3. Using strategy rm
    4. Applied associate-*r/8.1

      \[\leadsto \color{blue}{\frac{y \cdot x}{z}}\]
    5. Using strategy rm
    6. Applied associate-/l*8.2

      \[\leadsto \color{blue}{\frac{y}{\frac{z}{x}}}\]
    7. Using strategy rm
    8. Applied associate-/r/0.2

      \[\leadsto \color{blue}{\frac{y}{z} \cdot x}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification3.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le 4.279263918164063 \cdot 10^{-295}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;\frac{y}{z} \le 4.999939969196146 \cdot 10^{+208}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \end{array}\]

Runtime

Time bar (total: 4.8s)Debug logProfile

herbie shell --seed 2018235 +o rules:numerics
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1"
  (* x (/ (* (/ y z) t) t)))