exp-w (used to crash)

Percentage Accurate: 99.4% → 99.4%
Time: 10.9s
Alternatives: 9
Speedup: 305.0×

Specification

?
\[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]

Your Program's Arguments

Results

Enter valid numbers for all inputs

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 9 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Alternative 1: 99.4% accurate, 1.0× speedup?

\[{\ell}^{\left(e^{w}\right)} \cdot \frac{-1}{-e^{w}} \]
Derivation
  1. Initial program 99.7%

    \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
  2. Step-by-step derivation
    1. exp-neg99.7%

      \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. associate-*l/99.7%

      \[\leadsto \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
    3. *-lft-identity99.7%

      \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{w}} \]
  3. Simplified99.7%

    \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
  4. Step-by-step derivation
    1. frac-2neg99.7%

      \[\leadsto \color{blue}{\frac{-{\ell}^{\left(e^{w}\right)}}{-e^{w}}} \]
    2. div-inv99.7%

      \[\leadsto \color{blue}{\left(-{\ell}^{\left(e^{w}\right)}\right) \cdot \frac{1}{-e^{w}}} \]
  5. Applied egg-rr99.7%

    \[\leadsto \color{blue}{\left(-{\ell}^{\left(e^{w}\right)}\right) \cdot \frac{1}{-e^{w}}} \]
  6. Final simplification99.7%

    \[\leadsto {\ell}^{\left(e^{w}\right)} \cdot \frac{-1}{-e^{w}} \]

Alternative 2: 99.4% accurate, 1.0× speedup?

\[{\ell}^{\left(e^{w}\right)} \cdot e^{-w} \]
Derivation
  1. Initial program 99.7%

    \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
  2. Final simplification99.7%

    \[\leadsto {\ell}^{\left(e^{w}\right)} \cdot e^{-w} \]

Alternative 3: 99.4% accurate, 1.0× speedup?

\[\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}} \]
Derivation
  1. Initial program 99.7%

    \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
  2. Step-by-step derivation
    1. exp-neg99.7%

      \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. associate-*l/99.7%

      \[\leadsto \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
    3. *-lft-identity99.7%

      \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{w}} \]
  3. Simplified99.7%

    \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
  4. Final simplification99.7%

    \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{e^{w}} \]

Alternative 4: 97.7% accurate, 2.9× speedup?

\[\begin{array}{l} \mathbf{if}\;w \leq -0.7 \lor \neg \left(w \leq 620\right):\\ \;\;\;\;e^{-w}\\ \mathbf{else}:\\ \;\;\;\;\ell\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if w < -0.69999999999999996 or 620 < w

    1. Initial program 99.9%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Step-by-step derivation
      1. exp-neg99.9%

        \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      2. associate-*l/99.9%

        \[\leadsto \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
      3. *-lft-identity99.9%

        \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{w}} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
    4. Step-by-step derivation
      1. frac-2neg99.9%

        \[\leadsto \color{blue}{\frac{-{\ell}^{\left(e^{w}\right)}}{-e^{w}}} \]
      2. div-inv99.9%

        \[\leadsto \color{blue}{\left(-{\ell}^{\left(e^{w}\right)}\right) \cdot \frac{1}{-e^{w}}} \]
    5. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\left(-{\ell}^{\left(e^{w}\right)}\right) \cdot \frac{1}{-e^{w}}} \]
    6. Step-by-step derivation
      1. un-div-inv99.9%

        \[\leadsto \color{blue}{\frac{-{\ell}^{\left(e^{w}\right)}}{-e^{w}}} \]
      2. frac-2neg99.9%

        \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
      3. pow-to-exp100.0%

        \[\leadsto \frac{\color{blue}{e^{\log \ell \cdot e^{w}}}}{e^{w}} \]
      4. div-exp100.0%

        \[\leadsto \color{blue}{e^{\log \ell \cdot e^{w} - w}} \]
      5. *-commutative100.0%

        \[\leadsto e^{\color{blue}{e^{w} \cdot \log \ell} - w} \]
    7. Applied egg-rr100.0%

      \[\leadsto \color{blue}{e^{e^{w} \cdot \log \ell - w}} \]
    8. Taylor expanded in w around inf 99.2%

      \[\leadsto e^{\color{blue}{-1 \cdot w}} \]
    9. Step-by-step derivation
      1. neg-mul-199.2%

        \[\leadsto e^{\color{blue}{-w}} \]
    10. Simplified99.2%

      \[\leadsto e^{\color{blue}{-w}} \]

    if -0.69999999999999996 < w < 620

    1. Initial program 99.5%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Step-by-step derivation
      1. exp-neg99.5%

        \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      2. associate-*l/99.5%

        \[\leadsto \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
      3. *-lft-identity99.5%

        \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{w}} \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
    4. Step-by-step derivation
      1. frac-2neg99.5%

        \[\leadsto \color{blue}{\frac{-{\ell}^{\left(e^{w}\right)}}{-e^{w}}} \]
      2. div-inv99.5%

        \[\leadsto \color{blue}{\left(-{\ell}^{\left(e^{w}\right)}\right) \cdot \frac{1}{-e^{w}}} \]
    5. Applied egg-rr99.5%

      \[\leadsto \color{blue}{\left(-{\ell}^{\left(e^{w}\right)}\right) \cdot \frac{1}{-e^{w}}} \]
    6. Taylor expanded in w around 0 96.4%

      \[\leadsto \color{blue}{\ell} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq -0.7 \lor \neg \left(w \leq 620\right):\\ \;\;\;\;e^{-w}\\ \mathbf{else}:\\ \;\;\;\;\ell\\ \end{array} \]

Alternative 5: 97.6% accurate, 2.9× speedup?

\[\ell \cdot e^{-w} \]
Derivation
  1. Initial program 99.7%

    \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
  2. Taylor expanded in w around 0 97.5%

    \[\leadsto e^{-w} \cdot \color{blue}{\ell} \]
  3. Final simplification97.5%

    \[\leadsto \ell \cdot e^{-w} \]

Alternative 6: 97.6% accurate, 3.0× speedup?

\[\frac{\ell}{e^{w}} \]
Derivation
  1. Initial program 99.7%

    \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
  2. Step-by-step derivation
    1. exp-neg99.7%

      \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. associate-*l/99.7%

      \[\leadsto \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
    3. *-lft-identity99.7%

      \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{w}} \]
  3. Simplified99.7%

    \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
  4. Taylor expanded in w around 0 97.5%

    \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
  5. Final simplification97.5%

    \[\leadsto \frac{\ell}{e^{w}} \]

Alternative 7: 64.0% accurate, 50.3× speedup?

\[\begin{array}{l} \mathbf{if}\;w \leq -620:\\ \;\;\;\;\ell \cdot \left(-w\right)\\ \mathbf{else}:\\ \;\;\;\;\ell\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if w < -620

    1. Initial program 100.0%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Step-by-step derivation
      1. exp-neg100.0%

        \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      2. associate-*l/100.0%

        \[\leadsto \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
      3. *-lft-identity100.0%

        \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{w}} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
    4. Taylor expanded in w around 0 100.0%

      \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
    5. Taylor expanded in w around 0 27.5%

      \[\leadsto \color{blue}{-1 \cdot \left(\ell \cdot w\right) + \ell} \]
    6. Step-by-step derivation
      1. +-commutative27.5%

        \[\leadsto \color{blue}{\ell + -1 \cdot \left(\ell \cdot w\right)} \]
      2. mul-1-neg27.5%

        \[\leadsto \ell + \color{blue}{\left(-\ell \cdot w\right)} \]
      3. unsub-neg27.5%

        \[\leadsto \color{blue}{\ell - \ell \cdot w} \]
    7. Simplified27.5%

      \[\leadsto \color{blue}{\ell - \ell \cdot w} \]
    8. Taylor expanded in w around inf 27.5%

      \[\leadsto \color{blue}{-1 \cdot \left(\ell \cdot w\right)} \]
    9. Step-by-step derivation
      1. associate-*r*27.5%

        \[\leadsto \color{blue}{\left(-1 \cdot \ell\right) \cdot w} \]
      2. mul-1-neg27.5%

        \[\leadsto \color{blue}{\left(-\ell\right)} \cdot w \]
    10. Simplified27.5%

      \[\leadsto \color{blue}{\left(-\ell\right) \cdot w} \]

    if -620 < w

    1. Initial program 99.6%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Step-by-step derivation
      1. exp-neg99.6%

        \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      2. associate-*l/99.6%

        \[\leadsto \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
      3. *-lft-identity99.6%

        \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{w}} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
    4. Step-by-step derivation
      1. frac-2neg99.6%

        \[\leadsto \color{blue}{\frac{-{\ell}^{\left(e^{w}\right)}}{-e^{w}}} \]
      2. div-inv99.6%

        \[\leadsto \color{blue}{\left(-{\ell}^{\left(e^{w}\right)}\right) \cdot \frac{1}{-e^{w}}} \]
    5. Applied egg-rr99.6%

      \[\leadsto \color{blue}{\left(-{\ell}^{\left(e^{w}\right)}\right) \cdot \frac{1}{-e^{w}}} \]
    6. Taylor expanded in w around 0 76.6%

      \[\leadsto \color{blue}{\ell} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification63.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq -620:\\ \;\;\;\;\ell \cdot \left(-w\right)\\ \mathbf{else}:\\ \;\;\;\;\ell\\ \end{array} \]

Alternative 8: 63.7% accurate, 61.0× speedup?

\[\ell \cdot \left(1 - w\right) \]
Derivation
  1. Initial program 99.7%

    \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
  2. Step-by-step derivation
    1. exp-neg99.7%

      \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. associate-*l/99.7%

      \[\leadsto \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
    3. *-lft-identity99.7%

      \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{w}} \]
  3. Simplified99.7%

    \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
  4. Taylor expanded in w around 0 97.5%

    \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
  5. Taylor expanded in w around 0 63.5%

    \[\leadsto \color{blue}{-1 \cdot \left(\ell \cdot w\right) + \ell} \]
  6. Step-by-step derivation
    1. +-commutative63.5%

      \[\leadsto \color{blue}{\ell + -1 \cdot \left(\ell \cdot w\right)} \]
    2. mul-1-neg63.5%

      \[\leadsto \ell + \color{blue}{\left(-\ell \cdot w\right)} \]
    3. unsub-neg63.5%

      \[\leadsto \color{blue}{\ell - \ell \cdot w} \]
  7. Simplified63.5%

    \[\leadsto \color{blue}{\ell - \ell \cdot w} \]
  8. Taylor expanded in l around 0 63.5%

    \[\leadsto \color{blue}{\left(1 - w\right) \cdot \ell} \]
  9. Final simplification63.5%

    \[\leadsto \ell \cdot \left(1 - w\right) \]

Alternative 9: 57.0% accurate, 305.0× speedup?

\[\ell \]
Derivation
  1. Initial program 99.7%

    \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
  2. Step-by-step derivation
    1. exp-neg99.7%

      \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. associate-*l/99.7%

      \[\leadsto \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
    3. *-lft-identity99.7%

      \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{w}} \]
  3. Simplified99.7%

    \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
  4. Step-by-step derivation
    1. frac-2neg99.7%

      \[\leadsto \color{blue}{\frac{-{\ell}^{\left(e^{w}\right)}}{-e^{w}}} \]
    2. div-inv99.7%

      \[\leadsto \color{blue}{\left(-{\ell}^{\left(e^{w}\right)}\right) \cdot \frac{1}{-e^{w}}} \]
  5. Applied egg-rr99.7%

    \[\leadsto \color{blue}{\left(-{\ell}^{\left(e^{w}\right)}\right) \cdot \frac{1}{-e^{w}}} \]
  6. Taylor expanded in w around 0 57.7%

    \[\leadsto \color{blue}{\ell} \]
  7. Final simplification57.7%

    \[\leadsto \ell \]

Reproduce

?
herbie shell --seed 2023167 
(FPCore (w l)
  :name "exp-w (used to crash)"
  :precision binary64
  (* (exp (- w)) (pow l (exp w))))