Average Error: 14.3 → 1.5
Time: 19.8s
Precision: 64
Internal Precision: 320
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} = -\infty:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le -4.3705006904474905 \cdot 10^{-82}:\\ \;\;\;\;x \cdot \frac{\frac{y}{z} \cdot t}{t}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le 8.498717727350434 \cdot 10^{-236}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le 4.6054471631997205 \cdot 10^{+247}:\\ \;\;\;\;x \cdot \frac{\frac{y}{z} \cdot t}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \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 3 regimes
  2. if (/ (* (/ y z) t) t) < -inf.0 or 4.6054471631997205e+247 < (/ (* (/ y z) t) t)

    1. Initial program 56.3

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

      \[\leadsto y \cdot \frac{x}{z}\]

    if -inf.0 < (/ (* (/ y z) t) t) < -4.3705006904474905e-82 or 8.498717727350434e-236 < (/ (* (/ y z) t) t) < 4.6054471631997205e+247

    1. Initial program 0.5

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]

    if -4.3705006904474905e-82 < (/ (* (/ y z) t) t) < 8.498717727350434e-236

    1. Initial program 17.8

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

      \[\leadsto y \cdot \frac{x}{z}\]
    3. Taylor expanded around 0 2.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} = -\infty:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le -4.3705006904474905 \cdot 10^{-82}:\\ \;\;\;\;x \cdot \frac{\frac{y}{z} \cdot t}{t}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le 8.498717727350434 \cdot 10^{-236}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le 4.6054471631997205 \cdot 10^{+247}:\\ \;\;\;\;x \cdot \frac{\frac{y}{z} \cdot t}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \end{array}\]

Runtime

Time bar (total: 19.8s)Debug logProfile

herbie shell --seed 2018234 +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)))