Average Error: 14.1 → 2.2
Time: 29.1s
Precision: 64
Internal Precision: 384
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \le -inf.0:\\ \;\;\;\;\frac{1}{\frac{z}{y \cdot x}}\\ \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \le -1.0070314005033517 \cdot 10^{-202}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \le 4.452816302060219 \cdot 10^{-280}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Split input into 4 regimes
  2. if (/ (* (/ y z) t) t)

    1. Initial program 60.7

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Applied simplify24.0

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}}\]
    3. Taylor expanded around 0 2.1

      \[\leadsto \color{blue}{\frac{y \cdot x}{z}}\]
    4. Using strategy rm
    5. Applied clear-num2.2

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

    if (/ (* (/ y z) t) t) < -1.0070314005033517e-202

    1. Initial program 0.6

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Applied simplify0.3

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

    if -1.0070314005033517e-202 < (/ (* (/ y z) t) t) < 4.452816302060219e-280

    1. Initial program 23.1

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Applied simplify10.4

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}}\]
    3. Using strategy rm
    4. Applied associate-/r/1.5

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

    if 4.452816302060219e-280 < (/ (* (/ y z) t) t)

    1. Initial program 10.1

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Applied simplify4.1

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}}\]
    3. Using strategy rm
    4. Applied div-inv4.4

      \[\leadsto \color{blue}{x \cdot \frac{1}{\frac{z}{y}}}\]
    5. Applied simplify4.3

      \[\leadsto x \cdot \color{blue}{\frac{y}{z}}\]
  3. Recombined 4 regimes into one program.
  4. Removed slow pow expressions.

Runtime

Time bar (total: 29.1s)Debug logProfile

herbie shell --seed '#(1063154770 1824007522 645063331 41291047 494775821 1237684644)' 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1"
  (* x (/ (* (/ y z) t) t)))