Compound Interest Percentage Accurate: 28.1% → 98.0%
Time: 19.6s
Alternatives: 18
Speedup: 38.0×
could not determine a ground truth (more) Specification ? \[\begin{array}{l}
t_0 := \frac{i}{n}\\
100 \cdot \frac{{\left(1 + t_0\right)}^{n} - 1}{t_0}
\end{array}
\]
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? 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: 98.0% accurate, 0.3× speedup? \[\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t_1 \leq 0:\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{n}}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;n \cdot \frac{t_0 \cdot 100 + -100}{i}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\end{array}
\]
Derivation Split input into 3 regimes if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0 Initial program 28.1%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Step-by-step derivation *-un-lft-identity28.1%
\[\leadsto 100 \cdot \frac{\color{blue}{1 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}}{\frac{i}{n}}
\]
pow-to-exp26.5%
\[\leadsto 100 \cdot \frac{1 \cdot \left(\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1\right)}{\frac{i}{n}}
\]
expm1-def38.3%
\[\leadsto 100 \cdot \frac{1 \cdot \color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)}}{\frac{i}{n}}
\]
*-commutative38.3%
\[\leadsto 100 \cdot \frac{1 \cdot \mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}}
\]
log1p-udef98.1%
\[\leadsto 100 \cdot \frac{1 \cdot \mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right)}{\frac{i}{n}}
\]
Applied egg-rr 98.1%
\[\leadsto 100 \cdot \frac{\color{blue}{1 \cdot \mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}}
\]
Step-by-step derivation *-lft-identity98.1%
\[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}}
\]
Simplified98.1%
\[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}}
\]
if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0 Initial program 98.3%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Step-by-step derivation associate-/r/98.5%
\[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)}
\]
associate-*r*98.5%
\[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n}
\]
*-commutative98.5%
\[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)}
\]
associate-*r/98.5%
\[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}}
\]
sub-neg98.5%
\[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i}
\]
distribute-lft-in98.5%
\[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i}
\]
fma-def98.5%
\[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i}
\]
metadata-eval98.5%
\[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i}
\]
metadata-eval98.5%
\[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i}
\]
Simplified98.5%
\[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}}
\]
Step-by-step derivation fma-udef98.5%
\[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + -100}}{i}
\]
*-commutative98.5%
\[\leadsto n \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n} \cdot 100} + -100}{i}
\]
Applied egg-rr 98.5%
\[\leadsto n \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n} \cdot 100 + -100}}{i}
\]
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 1.9%
\[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}}
\]
Step-by-step derivation *-commutative1.9%
\[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100}
\]
associate-/l*1.9%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100
\]
expm1-def80.8%
\[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100
\]
Simplified80.8%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100}
\]
Taylor expanded in i around 0 100.0%
\[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100
\]
Step-by-step derivation *-commutative100.0%
\[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100
\]
Simplified100.0%
\[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100
\]
Recombined 3 regimes into one program. Final simplification98.5%
\[\leadsto \begin{array}{l}
\mathbf{if}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq 0:\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{n}}\\
\mathbf{elif}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq \infty:\\
\;\;\;\;n \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} \cdot 100 + -100}{i}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\end{array}
\]
Alternative 2: 83.1% accurate, 0.3× speedup? \[\begin{array}{l}
t_0 := \frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{elif}\;t_0 \leq \infty:\\
\;\;\;\;t_0 \cdot 100\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\end{array}
\]
Derivation Split input into 3 regimes if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0 Initial program 28.1%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 44.3%
\[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}}
\]
Step-by-step derivation *-commutative44.3%
\[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100}
\]
associate-/l*44.3%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100
\]
expm1-def75.7%
\[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100
\]
Simplified75.7%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100}
\]
if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0 Initial program 98.3%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 1.9%
\[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}}
\]
Step-by-step derivation *-commutative1.9%
\[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100}
\]
associate-/l*1.9%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100
\]
expm1-def80.8%
\[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100
\]
Simplified80.8%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100}
\]
Taylor expanded in i around 0 100.0%
\[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100
\]
Step-by-step derivation *-commutative100.0%
\[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100
\]
Simplified100.0%
\[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100
\]
Recombined 3 regimes into one program. Final simplification82.1%
\[\leadsto \begin{array}{l}
\mathbf{if}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq 0:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{elif}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq \infty:\\
\;\;\;\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \cdot 100\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\end{array}
\]
Alternative 3: 83.1% accurate, 0.3× speedup? \[\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t_1 \leq 0:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;n \cdot \frac{t_0 \cdot 100 + -100}{i}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\end{array}
\]
Derivation Split input into 3 regimes if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0 Initial program 28.1%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 44.3%
\[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}}
\]
Step-by-step derivation *-commutative44.3%
\[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100}
\]
associate-/l*44.3%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100
\]
expm1-def75.7%
\[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100
\]
Simplified75.7%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100}
\]
if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0 Initial program 98.3%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Step-by-step derivation associate-/r/98.5%
\[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)}
\]
associate-*r*98.5%
\[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n}
\]
*-commutative98.5%
\[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)}
\]
associate-*r/98.5%
\[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}}
\]
sub-neg98.5%
\[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i}
\]
distribute-lft-in98.5%
\[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i}
\]
fma-def98.5%
\[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i}
\]
metadata-eval98.5%
\[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i}
\]
metadata-eval98.5%
\[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i}
\]
Simplified98.5%
\[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}}
\]
Step-by-step derivation fma-udef98.5%
\[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + -100}}{i}
\]
*-commutative98.5%
\[\leadsto n \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n} \cdot 100} + -100}{i}
\]
Applied egg-rr 98.5%
\[\leadsto n \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n} \cdot 100 + -100}}{i}
\]
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 1.9%
\[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}}
\]
Step-by-step derivation *-commutative1.9%
\[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100}
\]
associate-/l*1.9%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100
\]
expm1-def80.8%
\[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100
\]
Simplified80.8%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100}
\]
Taylor expanded in i around 0 100.0%
\[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100
\]
Step-by-step derivation *-commutative100.0%
\[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100
\]
Simplified100.0%
\[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100
\]
Recombined 3 regimes into one program. Final simplification82.1%
\[\leadsto \begin{array}{l}
\mathbf{if}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq 0:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{elif}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq \infty:\\
\;\;\;\;n \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} \cdot 100 + -100}{i}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\end{array}
\]
Alternative 4: 74.9% accurate, 1.0× speedup? \[\begin{array}{l}
t_0 := 100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\
\mathbf{if}\;i \leq -1.3 \cdot 10^{-5}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;i \leq 1.35 \cdot 10^{-9}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)\\
\mathbf{elif}\;i \leq 1.82 \cdot 10^{+177}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;i \leq 2.8 \cdot 10^{+286}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{else}:\\
\;\;\;\;50 \cdot \left(i \cdot n\right)\\
\end{array}
\]
Derivation Split input into 4 regimes if i < -1.29999999999999992e-5 or 1.3500000000000001e-9 < i < 1.82e177 Initial program 43.8%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 70.5%
\[\leadsto 100 \cdot \frac{\color{blue}{e^{i} - 1}}{\frac{i}{n}}
\]
Step-by-step derivation expm1-def71.3%
\[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(i\right)}}{\frac{i}{n}}
\]
Simplified71.3%
\[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(i\right)}}{\frac{i}{n}}
\]
if -1.29999999999999992e-5 < i < 1.3500000000000001e-9 Initial program 9.2%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 10.4%
\[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}}
\]
Step-by-step derivation *-commutative10.4%
\[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100}
\]
associate-/l*10.4%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100
\]
expm1-def86.6%
\[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100
\]
Simplified86.6%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100}
\]
Step-by-step derivation associate-*l/86.6%
\[\leadsto \color{blue}{\frac{n \cdot 100}{\frac{i}{\mathsf{expm1}\left(i\right)}}}
\]
Applied egg-rr 86.6%
\[\leadsto \color{blue}{\frac{n \cdot 100}{\frac{i}{\mathsf{expm1}\left(i\right)}}}
\]
Taylor expanded in i around 0 86.6%
\[\leadsto \color{blue}{50 \cdot \left(n \cdot i\right) + \left(16.666666666666668 \cdot \left(n \cdot {i}^{2}\right) + 100 \cdot n\right)}
\]
Step-by-step derivation *-commutative86.6%
\[\leadsto 50 \cdot \left(n \cdot i\right) + \left(16.666666666666668 \cdot \left(n \cdot {i}^{2}\right) + \color{blue}{n \cdot 100}\right)
\]
associate-+r+86.6%
\[\leadsto \color{blue}{\left(50 \cdot \left(n \cdot i\right) + 16.666666666666668 \cdot \left(n \cdot {i}^{2}\right)\right) + n \cdot 100}
\]
Simplified86.6%
\[\leadsto \color{blue}{n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)}
\]
if 1.82e177 < i < 2.7999999999999998e286 Initial program 68.3%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 13.0%
\[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}}
\]
Step-by-step derivation *-commutative13.0%
\[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100}
\]
associate-/l*13.0%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100
\]
expm1-def13.0%
\[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100
\]
Simplified13.0%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100}
\]
Taylor expanded in i around 0 31.5%
\[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100
\]
Step-by-step derivation *-commutative31.5%
\[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100
\]
Simplified31.5%
\[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100
\]
if 2.7999999999999998e286 < i Initial program 99.5%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in i around 0 50.5%
\[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)}
\]
Step-by-step derivation associate-*r*50.5%
\[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right)
\]
*-commutative50.5%
\[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)
\]
associate-*r/50.5%
\[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)
\]
metadata-eval50.5%
\[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right)
\]
Simplified50.5%
\[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)}
\]
Taylor expanded in n around inf 50.5%
\[\leadsto 100 \cdot \color{blue}{\left(\left(1 + 0.5 \cdot i\right) \cdot n\right)}
\]
Taylor expanded in i around inf 50.5%
\[\leadsto \color{blue}{50 \cdot \left(n \cdot i\right)}
\]
Recombined 4 regimes into one program. Final simplification74.0%
\[\leadsto \begin{array}{l}
\mathbf{if}\;i \leq -1.3 \cdot 10^{-5}:\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\
\mathbf{elif}\;i \leq 1.35 \cdot 10^{-9}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)\\
\mathbf{elif}\;i \leq 1.82 \cdot 10^{+177}:\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\
\mathbf{elif}\;i \leq 2.8 \cdot 10^{+286}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{else}:\\
\;\;\;\;50 \cdot \left(i \cdot n\right)\\
\end{array}
\]
Alternative 5: 74.9% accurate, 1.0× speedup? \[\begin{array}{l}
\mathbf{if}\;i \leq -1.1 \cdot 10^{-7}:\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\
\mathbf{elif}\;i \leq 3 \cdot 10^{-12}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)\\
\mathbf{elif}\;i \leq 1.82 \cdot 10^{+177}:\\
\;\;\;\;100 \cdot \left(\mathsf{expm1}\left(i\right) \cdot \frac{n}{i}\right)\\
\mathbf{elif}\;i \leq 5.1 \cdot 10^{+286}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{else}:\\
\;\;\;\;50 \cdot \left(i \cdot n\right)\\
\end{array}
\]
Derivation Split input into 5 regimes if i < -1.1000000000000001e-7 Initial program 55.8%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 74.1%
\[\leadsto 100 \cdot \frac{\color{blue}{e^{i} - 1}}{\frac{i}{n}}
\]
Step-by-step derivation expm1-def74.2%
\[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(i\right)}}{\frac{i}{n}}
\]
Simplified74.2%
\[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(i\right)}}{\frac{i}{n}}
\]
if -1.1000000000000001e-7 < i < 3.0000000000000001e-12 Initial program 9.4%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 9.6%
\[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}}
\]
Step-by-step derivation *-commutative9.6%
\[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100}
\]
associate-/l*9.6%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100
\]
expm1-def86.3%
\[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100
\]
Simplified86.3%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100}
\]
Step-by-step derivation associate-*l/86.3%
\[\leadsto \color{blue}{\frac{n \cdot 100}{\frac{i}{\mathsf{expm1}\left(i\right)}}}
\]
Applied egg-rr 86.3%
\[\leadsto \color{blue}{\frac{n \cdot 100}{\frac{i}{\mathsf{expm1}\left(i\right)}}}
\]
Taylor expanded in i around 0 86.3%
\[\leadsto \color{blue}{50 \cdot \left(n \cdot i\right) + \left(16.666666666666668 \cdot \left(n \cdot {i}^{2}\right) + 100 \cdot n\right)}
\]
Step-by-step derivation *-commutative86.3%
\[\leadsto 50 \cdot \left(n \cdot i\right) + \left(16.666666666666668 \cdot \left(n \cdot {i}^{2}\right) + \color{blue}{n \cdot 100}\right)
\]
associate-+r+86.3%
\[\leadsto \color{blue}{\left(50 \cdot \left(n \cdot i\right) + 16.666666666666668 \cdot \left(n \cdot {i}^{2}\right)\right) + n \cdot 100}
\]
Simplified86.3%
\[\leadsto \color{blue}{n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)}
\]
if 3.0000000000000001e-12 < i < 1.82e177 Initial program 26.2%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 65.3%
\[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}}
\]
Step-by-step derivation *-commutative65.3%
\[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100}
\]
associate-/l*65.3%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100
\]
expm1-def68.7%
\[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100
\]
Simplified68.7%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100}
\]
Step-by-step derivation associate-/r/68.6%
\[\leadsto \color{blue}{\left(\frac{n}{i} \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100
\]
Applied egg-rr 68.6%
\[\leadsto \color{blue}{\left(\frac{n}{i} \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100
\]
if 1.82e177 < i < 5.09999999999999998e286 Initial program 68.3%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 13.0%
\[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}}
\]
Step-by-step derivation *-commutative13.0%
\[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100}
\]
associate-/l*13.0%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100
\]
expm1-def13.0%
\[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100
\]
Simplified13.0%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100}
\]
Taylor expanded in i around 0 31.5%
\[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100
\]
Step-by-step derivation *-commutative31.5%
\[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100
\]
Simplified31.5%
\[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100
\]
if 5.09999999999999998e286 < i Initial program 99.5%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in i around 0 50.5%
\[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)}
\]
Step-by-step derivation associate-*r*50.5%
\[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right)
\]
*-commutative50.5%
\[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)
\]
associate-*r/50.5%
\[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)
\]
metadata-eval50.5%
\[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right)
\]
Simplified50.5%
\[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)}
\]
Taylor expanded in n around inf 50.5%
\[\leadsto 100 \cdot \color{blue}{\left(\left(1 + 0.5 \cdot i\right) \cdot n\right)}
\]
Taylor expanded in i around inf 50.5%
\[\leadsto \color{blue}{50 \cdot \left(n \cdot i\right)}
\]
Recombined 5 regimes into one program. Final simplification74.0%
\[\leadsto \begin{array}{l}
\mathbf{if}\;i \leq -1.1 \cdot 10^{-7}:\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\
\mathbf{elif}\;i \leq 3 \cdot 10^{-12}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)\\
\mathbf{elif}\;i \leq 1.82 \cdot 10^{+177}:\\
\;\;\;\;100 \cdot \left(\mathsf{expm1}\left(i\right) \cdot \frac{n}{i}\right)\\
\mathbf{elif}\;i \leq 5.1 \cdot 10^{+286}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{else}:\\
\;\;\;\;50 \cdot \left(i \cdot n\right)\\
\end{array}
\]
Alternative 6: 82.0% accurate, 1.0× speedup? \[\begin{array}{l}
t_0 := 100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{if}\;n \leq -1.15 \cdot 10^{-178}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq 2.25 \cdot 10^{-213}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 3 \cdot 10^{-25}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Derivation Split input into 3 regimes if n < -1.14999999999999997e-178 or 2.9999999999999998e-25 < n Initial program 27.5%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 40.4%
\[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}}
\]
Step-by-step derivation *-commutative40.4%
\[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100}
\]
associate-/l*40.4%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100
\]
expm1-def82.6%
\[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100
\]
Simplified82.6%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100}
\]
if -1.14999999999999997e-178 < n < 2.2500000000000001e-213 Initial program 73.2%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Step-by-step derivation associate-*r/73.2%
\[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}}
\]
sub-neg73.2%
\[\leadsto \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{\frac{i}{n}}
\]
distribute-lft-in73.2%
\[\leadsto \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{\frac{i}{n}}
\]
fma-def73.2%
\[\leadsto \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{\frac{i}{n}}
\]
metadata-eval73.2%
\[\leadsto \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{\frac{i}{n}}
\]
metadata-eval73.2%
\[\leadsto \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{\frac{i}{n}}
\]
Simplified73.2%
\[\leadsto \color{blue}{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{\frac{i}{n}}}
\]
Taylor expanded in n around inf 50.1%
\[\leadsto \frac{\color{blue}{100 \cdot e^{i} - 100}}{\frac{i}{n}}
\]
Taylor expanded in i around 0 85.7%
\[\leadsto \frac{\color{blue}{100} - 100}{\frac{i}{n}}
\]
if 2.2500000000000001e-213 < n < 2.9999999999999998e-25 Initial program 15.4%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 3.4%
\[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}}
\]
Step-by-step derivation *-commutative3.4%
\[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100}
\]
associate-/l*3.4%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100
\]
expm1-def45.4%
\[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100
\]
Simplified45.4%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100}
\]
Taylor expanded in i around 0 58.2%
\[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100
\]
Step-by-step derivation *-commutative58.2%
\[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100
\]
Simplified58.2%
\[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100
\]
Recombined 3 regimes into one program. Final simplification79.7%
\[\leadsto \begin{array}{l}
\mathbf{if}\;n \leq -1.15 \cdot 10^{-178}:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{elif}\;n \leq 2.25 \cdot 10^{-213}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 3 \cdot 10^{-25}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\end{array}
\]
Alternative 7: 67.2% accurate, 5.9× speedup? \[\begin{array}{l}
t_0 := 100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{if}\;n \leq -1.85 \cdot 10^{-179}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq 7 \cdot 10^{-215}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.2 \cdot 10^{-25}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n + n \cdot \left(i \cdot \left(0.5 + i \cdot 0.16666666666666666\right)\right)\right)\\
\end{array}
\]
Derivation Split input into 3 regimes if n < -1.84999999999999995e-179 or 7.0000000000000004e-215 < n < 1.20000000000000005e-25 Initial program 28.9%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 28.9%
\[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}}
\]
Step-by-step derivation *-commutative28.9%
\[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100}
\]
associate-/l*28.9%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100
\]
expm1-def68.4%
\[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100
\]
Simplified68.4%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100}
\]
Taylor expanded in i around 0 53.5%
\[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100
\]
Step-by-step derivation *-commutative53.5%
\[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100
\]
Simplified53.5%
\[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100
\]
if -1.84999999999999995e-179 < n < 7.0000000000000004e-215 Initial program 73.2%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Step-by-step derivation associate-*r/73.2%
\[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}}
\]
sub-neg73.2%
\[\leadsto \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{\frac{i}{n}}
\]
distribute-lft-in73.2%
\[\leadsto \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{\frac{i}{n}}
\]
fma-def73.2%
\[\leadsto \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{\frac{i}{n}}
\]
metadata-eval73.2%
\[\leadsto \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{\frac{i}{n}}
\]
metadata-eval73.2%
\[\leadsto \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{\frac{i}{n}}
\]
Simplified73.2%
\[\leadsto \color{blue}{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{\frac{i}{n}}}
\]
Taylor expanded in n around inf 50.1%
\[\leadsto \frac{\color{blue}{100 \cdot e^{i} - 100}}{\frac{i}{n}}
\]
Taylor expanded in i around 0 85.7%
\[\leadsto \frac{\color{blue}{100} - 100}{\frac{i}{n}}
\]
if 1.20000000000000005e-25 < n Initial program 19.3%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Step-by-step derivation *-un-lft-identity19.3%
\[\leadsto 100 \cdot \frac{\color{blue}{1 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}}{\frac{i}{n}}
\]
pow-to-exp15.3%
\[\leadsto 100 \cdot \frac{1 \cdot \left(\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1\right)}{\frac{i}{n}}
\]
expm1-def17.1%
\[\leadsto 100 \cdot \frac{1 \cdot \color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)}}{\frac{i}{n}}
\]
*-commutative17.1%
\[\leadsto 100 \cdot \frac{1 \cdot \mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}}
\]
log1p-udef72.2%
\[\leadsto 100 \cdot \frac{1 \cdot \mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right)}{\frac{i}{n}}
\]
Applied egg-rr 72.2%
\[\leadsto 100 \cdot \frac{\color{blue}{1 \cdot \mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}}
\]
Step-by-step derivation *-lft-identity72.2%
\[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}}
\]
Simplified72.2%
\[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}}
\]
Taylor expanded in i around 0 67.8%
\[\leadsto 100 \cdot \color{blue}{\left(n + \left(n \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right) + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)}
\]
Step-by-step derivation distribute-lft-out68.0%
\[\leadsto 100 \cdot \left(n + \color{blue}{n \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)}\right)
\]
unpow268.0%
\[\leadsto 100 \cdot \left(n + n \cdot \left(\color{blue}{\left(i \cdot i\right)} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
associate--l+68.0%
\[\leadsto 100 \cdot \left(n + n \cdot \left(\left(i \cdot i\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)} + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
associate-*r/68.0%
\[\leadsto 100 \cdot \left(n + n \cdot \left(\left(i \cdot i\right) \cdot \left(\color{blue}{\frac{0.3333333333333333 \cdot 1}{{n}^{2}}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
metadata-eval68.0%
\[\leadsto 100 \cdot \left(n + n \cdot \left(\left(i \cdot i\right) \cdot \left(\frac{\color{blue}{0.3333333333333333}}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
unpow268.0%
\[\leadsto 100 \cdot \left(n + n \cdot \left(\left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{\color{blue}{n \cdot n}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
associate-*r/68.0%
\[\leadsto 100 \cdot \left(n + n \cdot \left(\left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
metadata-eval68.0%
\[\leadsto 100 \cdot \left(n + n \cdot \left(\left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{\color{blue}{0.5}}{n}\right)\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
associate-*l*68.0%
\[\leadsto 100 \cdot \left(n + n \cdot \left(\color{blue}{i \cdot \left(i \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{0.5}{n}\right)\right)\right)} + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
associate-*r/68.0%
\[\leadsto 100 \cdot \left(n + n \cdot \left(i \cdot \left(i \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{0.5}{n}\right)\right)\right) + i \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)\right)
\]
metadata-eval68.0%
\[\leadsto 100 \cdot \left(n + n \cdot \left(i \cdot \left(i \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{0.5}{n}\right)\right)\right) + i \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right)\right)
\]
Simplified68.0%
\[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(i \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{0.5}{n}\right)\right) + \left(0.5 - \frac{0.5}{n}\right)\right)\right)\right)}
\]
Taylor expanded in n around inf 68.0%
\[\leadsto 100 \cdot \left(n + n \cdot \color{blue}{\left(\left(0.5 + 0.16666666666666666 \cdot i\right) \cdot i\right)}\right)
\]
Recombined 3 regimes into one program. Final simplification61.9%
\[\leadsto \begin{array}{l}
\mathbf{if}\;n \leq -1.85 \cdot 10^{-179}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{elif}\;n \leq 7 \cdot 10^{-215}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.2 \cdot 10^{-25}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n + n \cdot \left(i \cdot \left(0.5 + i \cdot 0.16666666666666666\right)\right)\right)\\
\end{array}
\]
Alternative 8: 67.2% accurate, 6.6× speedup? \[\begin{array}{l}
t_0 := 100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{if}\;n \leq -8.6 \cdot 10^{-179}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq 6.6 \cdot 10^{-215}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 2.4 \cdot 10^{-25}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)\\
\end{array}
\]
Derivation Split input into 3 regimes if n < -8.60000000000000052e-179 or 6.5999999999999996e-215 < n < 2.40000000000000009e-25 Initial program 28.9%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 28.9%
\[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}}
\]
Step-by-step derivation *-commutative28.9%
\[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100}
\]
associate-/l*28.9%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100
\]
expm1-def68.4%
\[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100
\]
Simplified68.4%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100}
\]
Taylor expanded in i around 0 53.5%
\[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100
\]
Step-by-step derivation *-commutative53.5%
\[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100
\]
Simplified53.5%
\[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100
\]
if -8.60000000000000052e-179 < n < 6.5999999999999996e-215 Initial program 73.2%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Step-by-step derivation associate-*r/73.2%
\[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}}
\]
sub-neg73.2%
\[\leadsto \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{\frac{i}{n}}
\]
distribute-lft-in73.2%
\[\leadsto \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{\frac{i}{n}}
\]
fma-def73.2%
\[\leadsto \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{\frac{i}{n}}
\]
metadata-eval73.2%
\[\leadsto \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{\frac{i}{n}}
\]
metadata-eval73.2%
\[\leadsto \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{\frac{i}{n}}
\]
Simplified73.2%
\[\leadsto \color{blue}{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{\frac{i}{n}}}
\]
Taylor expanded in n around inf 50.1%
\[\leadsto \frac{\color{blue}{100 \cdot e^{i} - 100}}{\frac{i}{n}}
\]
Taylor expanded in i around 0 85.7%
\[\leadsto \frac{\color{blue}{100} - 100}{\frac{i}{n}}
\]
if 2.40000000000000009e-25 < n Initial program 19.3%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 46.3%
\[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}}
\]
Step-by-step derivation *-commutative46.3%
\[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100}
\]
associate-/l*46.3%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100
\]
expm1-def93.5%
\[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100
\]
Simplified93.5%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100}
\]
Step-by-step derivation associate-*l/93.5%
\[\leadsto \color{blue}{\frac{n \cdot 100}{\frac{i}{\mathsf{expm1}\left(i\right)}}}
\]
Applied egg-rr 93.5%
\[\leadsto \color{blue}{\frac{n \cdot 100}{\frac{i}{\mathsf{expm1}\left(i\right)}}}
\]
Taylor expanded in i around 0 67.8%
\[\leadsto \color{blue}{50 \cdot \left(n \cdot i\right) + \left(16.666666666666668 \cdot \left(n \cdot {i}^{2}\right) + 100 \cdot n\right)}
\]
Step-by-step derivation *-commutative67.8%
\[\leadsto 50 \cdot \left(n \cdot i\right) + \left(16.666666666666668 \cdot \left(n \cdot {i}^{2}\right) + \color{blue}{n \cdot 100}\right)
\]
associate-+r+67.8%
\[\leadsto \color{blue}{\left(50 \cdot \left(n \cdot i\right) + 16.666666666666668 \cdot \left(n \cdot {i}^{2}\right)\right) + n \cdot 100}
\]
Simplified68.0%
\[\leadsto \color{blue}{n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)}
\]
Recombined 3 regimes into one program. Final simplification61.9%
\[\leadsto \begin{array}{l}
\mathbf{if}\;n \leq -8.6 \cdot 10^{-179}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{elif}\;n \leq 6.6 \cdot 10^{-215}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 2.4 \cdot 10^{-25}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)\\
\end{array}
\]
Alternative 9: 65.9% accurate, 7.5× speedup? \[\begin{array}{l}
t_0 := 100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{if}\;n \leq -1.6 \cdot 10^{-177}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq 2.4 \cdot 10^{-214}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 6.1 \cdot 10^{-27}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n \cdot \left(1 + i \cdot 0.5\right)\right)\\
\end{array}
\]
Derivation Split input into 3 regimes if n < -1.5999999999999999e-177 or 2.4000000000000002e-214 < n < 6.0999999999999999e-27 Initial program 28.9%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in n around inf 28.9%
\[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}}
\]
Step-by-step derivation *-commutative28.9%
\[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100}
\]
associate-/l*28.9%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100
\]
expm1-def68.4%
\[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100
\]
Simplified68.4%
\[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100}
\]
Taylor expanded in i around 0 53.5%
\[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100
\]
Step-by-step derivation *-commutative53.5%
\[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100
\]
Simplified53.5%
\[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100
\]
if -1.5999999999999999e-177 < n < 2.4000000000000002e-214 Initial program 73.2%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Step-by-step derivation associate-*r/73.2%
\[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}}
\]
sub-neg73.2%
\[\leadsto \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{\frac{i}{n}}
\]
distribute-lft-in73.2%
\[\leadsto \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{\frac{i}{n}}
\]
fma-def73.2%
\[\leadsto \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{\frac{i}{n}}
\]
metadata-eval73.2%
\[\leadsto \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{\frac{i}{n}}
\]
metadata-eval73.2%
\[\leadsto \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{\frac{i}{n}}
\]
Simplified73.2%
\[\leadsto \color{blue}{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{\frac{i}{n}}}
\]
Taylor expanded in n around inf 50.1%
\[\leadsto \frac{\color{blue}{100 \cdot e^{i} - 100}}{\frac{i}{n}}
\]
Taylor expanded in i around 0 85.7%
\[\leadsto \frac{\color{blue}{100} - 100}{\frac{i}{n}}
\]
if 6.0999999999999999e-27 < n Initial program 19.3%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in i around 0 65.8%
\[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)}
\]
Step-by-step derivation associate-*r*65.8%
\[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right)
\]
*-commutative65.8%
\[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)
\]
associate-*r/65.8%
\[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)
\]
metadata-eval65.8%
\[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right)
\]
Simplified65.8%
\[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)}
\]
Taylor expanded in n around inf 65.9%
\[\leadsto 100 \cdot \color{blue}{\left(\left(1 + 0.5 \cdot i\right) \cdot n\right)}
\]
Recombined 3 regimes into one program. Final simplification61.2%
\[\leadsto \begin{array}{l}
\mathbf{if}\;n \leq -1.6 \cdot 10^{-177}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{elif}\;n \leq 2.4 \cdot 10^{-214}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 6.1 \cdot 10^{-27}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n \cdot \left(1 + i \cdot 0.5\right)\right)\\
\end{array}
\]
Alternative 10: 63.7% accurate, 10.2× speedup? \[\begin{array}{l}
\mathbf{if}\;n \leq -6800000 \lor \neg \left(n \leq 8.8 \cdot 10^{-10}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\end{array}
\]
Derivation Split input into 2 regimes if n < -6.8e6 or 8.7999999999999996e-10 < n Initial program 27.5%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Step-by-step derivation associate-/r/28.0%
\[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)}
\]
associate-*r*28.0%
\[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n}
\]
*-commutative28.0%
\[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)}
\]
associate-*r/28.0%
\[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}}
\]
sub-neg28.0%
\[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i}
\]
distribute-lft-in28.0%
\[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i}
\]
fma-def28.0%
\[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i}
\]
metadata-eval28.0%
\[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i}
\]
metadata-eval28.0%
\[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i}
\]
Simplified28.0%
\[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}}
\]
Taylor expanded in i around 0 59.6%
\[\leadsto n \cdot \color{blue}{\left(100 + \left(100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)}
\]
Step-by-step derivation distribute-lft-out59.6%
\[\leadsto n \cdot \left(100 + \color{blue}{100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)}\right)
\]
associate-*r/59.6%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
metadata-eval59.6%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
unpow259.6%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \color{blue}{\left(i \cdot i\right)} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
associate--l+59.6%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)}\right)\right)
\]
associate-*r/59.6%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\color{blue}{\frac{0.3333333333333333 \cdot 1}{{n}^{2}}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)
\]
metadata-eval59.6%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{\color{blue}{0.3333333333333333}}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)
\]
unpow259.6%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{\color{blue}{n \cdot n}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)
\]
associate-*r/59.6%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)\right)\right)
\]
metadata-eval59.6%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{\color{blue}{0.5}}{n}\right)\right)\right)\right)
\]
Simplified59.6%
\[\leadsto n \cdot \color{blue}{\left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{0.5}{n}\right)\right)\right)\right)}
\]
Taylor expanded in n around inf 59.6%
\[\leadsto \color{blue}{n \cdot \left(100 + 100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right)\right)}
\]
Step-by-step derivation distribute-lft-in59.6%
\[\leadsto n \cdot \left(100 + \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + 100 \cdot \left(0.5 \cdot i\right)\right)}\right)
\]
associate-*r*59.6%
\[\leadsto n \cdot \left(100 + \left(\color{blue}{\left(100 \cdot 0.16666666666666666\right) \cdot {i}^{2}} + 100 \cdot \left(0.5 \cdot i\right)\right)\right)
\]
metadata-eval59.6%
\[\leadsto n \cdot \left(100 + \left(\color{blue}{16.666666666666668} \cdot {i}^{2} + 100 \cdot \left(0.5 \cdot i\right)\right)\right)
\]
unpow259.6%
\[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \color{blue}{\left(i \cdot i\right)} + 100 \cdot \left(0.5 \cdot i\right)\right)\right)
\]
associate-*r*59.6%
\[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{\left(100 \cdot 0.5\right) \cdot i}\right)\right)
\]
metadata-eval59.6%
\[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{50} \cdot i\right)\right)
\]
Simplified59.6%
\[\leadsto \color{blue}{n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + 50 \cdot i\right)\right)}
\]
Taylor expanded in i around 0 56.9%
\[\leadsto n \cdot \left(100 + \color{blue}{50 \cdot i}\right)
\]
Step-by-step derivation *-commutative56.9%
\[\leadsto n \cdot \left(100 + \color{blue}{i \cdot 50}\right)
\]
Simplified56.9%
\[\leadsto n \cdot \left(100 + \color{blue}{i \cdot 50}\right)
\]
if -6.8e6 < n < 8.7999999999999996e-10 Initial program 38.3%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in i around 0 54.4%
\[\leadsto 100 \cdot \frac{\color{blue}{i}}{\frac{i}{n}}
\]
Recombined 2 regimes into one program. Final simplification55.9%
\[\leadsto \begin{array}{l}
\mathbf{if}\;n \leq -6800000 \lor \neg \left(n \leq 8.8 \cdot 10^{-10}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\end{array}
\]
Alternative 11: 61.9% accurate, 10.2× speedup? \[\begin{array}{l}
\mathbf{if}\;i \leq -10000000:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{elif}\;i \leq 4.5 \cdot 10^{+31}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\
\end{array}
\]
Derivation Split input into 3 regimes if i < -1e7 Initial program 54.5%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in i around 0 22.9%
\[\leadsto 100 \cdot \frac{\color{blue}{i}}{\frac{i}{n}}
\]
if -1e7 < i < 4.4999999999999996e31 Initial program 12.5%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in i around 0 76.0%
\[\leadsto \color{blue}{100 \cdot n}
\]
Step-by-step derivation *-commutative76.0%
\[\leadsto \color{blue}{n \cdot 100}
\]
Simplified76.0%
\[\leadsto \color{blue}{n \cdot 100}
\]
if 4.4999999999999996e31 < i Initial program 52.7%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Step-by-step derivation associate-/r/53.0%
\[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)}
\]
associate-*r*53.0%
\[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n}
\]
*-commutative53.0%
\[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)}
\]
associate-*r/53.0%
\[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}}
\]
sub-neg53.0%
\[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i}
\]
distribute-lft-in53.0%
\[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i}
\]
fma-def53.0%
\[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i}
\]
metadata-eval53.0%
\[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i}
\]
metadata-eval53.0%
\[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i}
\]
Simplified53.0%
\[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}}
\]
Taylor expanded in i around 0 32.4%
\[\leadsto n \cdot \color{blue}{\left(100 + \left(100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)}
\]
Step-by-step derivation distribute-lft-out32.4%
\[\leadsto n \cdot \left(100 + \color{blue}{100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)}\right)
\]
associate-*r/32.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
metadata-eval32.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
unpow232.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \color{blue}{\left(i \cdot i\right)} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
associate--l+32.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)}\right)\right)
\]
associate-*r/32.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\color{blue}{\frac{0.3333333333333333 \cdot 1}{{n}^{2}}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)
\]
metadata-eval32.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{\color{blue}{0.3333333333333333}}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)
\]
unpow232.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{\color{blue}{n \cdot n}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)
\]
associate-*r/32.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)\right)\right)
\]
metadata-eval32.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{\color{blue}{0.5}}{n}\right)\right)\right)\right)
\]
Simplified32.4%
\[\leadsto n \cdot \color{blue}{\left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{0.5}{n}\right)\right)\right)\right)}
\]
Taylor expanded in n around inf 32.7%
\[\leadsto \color{blue}{n \cdot \left(100 + 100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right)\right)}
\]
Step-by-step derivation distribute-lft-in32.7%
\[\leadsto n \cdot \left(100 + \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + 100 \cdot \left(0.5 \cdot i\right)\right)}\right)
\]
associate-*r*32.7%
\[\leadsto n \cdot \left(100 + \left(\color{blue}{\left(100 \cdot 0.16666666666666666\right) \cdot {i}^{2}} + 100 \cdot \left(0.5 \cdot i\right)\right)\right)
\]
metadata-eval32.7%
\[\leadsto n \cdot \left(100 + \left(\color{blue}{16.666666666666668} \cdot {i}^{2} + 100 \cdot \left(0.5 \cdot i\right)\right)\right)
\]
unpow232.7%
\[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \color{blue}{\left(i \cdot i\right)} + 100 \cdot \left(0.5 \cdot i\right)\right)\right)
\]
associate-*r*32.7%
\[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{\left(100 \cdot 0.5\right) \cdot i}\right)\right)
\]
metadata-eval32.7%
\[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{50} \cdot i\right)\right)
\]
Simplified32.7%
\[\leadsto \color{blue}{n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + 50 \cdot i\right)\right)}
\]
Taylor expanded in i around inf 32.7%
\[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot {i}^{2}\right)}
\]
Step-by-step derivation unpow232.7%
\[\leadsto 16.666666666666668 \cdot \left(n \cdot \color{blue}{\left(i \cdot i\right)}\right)
\]
Simplified32.7%
\[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)}
\]
Recombined 3 regimes into one program. Final simplification53.6%
\[\leadsto \begin{array}{l}
\mathbf{if}\;i \leq -10000000:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{elif}\;i \leq 4.5 \cdot 10^{+31}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\
\end{array}
\]
Alternative 12: 61.2% accurate, 10.3× speedup? \[\begin{array}{l}
\mathbf{if}\;i \leq -1.06 \cdot 10^{-10}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n + n \cdot \left(i \cdot 0.5\right)\right)\\
\end{array}
\]
Derivation Split input into 2 regimes if i < -1.06e-10 Initial program 56.5%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Step-by-step derivation associate-*r/56.5%
\[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}}
\]
sub-neg56.5%
\[\leadsto \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{\frac{i}{n}}
\]
distribute-lft-in56.5%
\[\leadsto \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{\frac{i}{n}}
\]
fma-def56.5%
\[\leadsto \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{\frac{i}{n}}
\]
metadata-eval56.5%
\[\leadsto \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{\frac{i}{n}}
\]
metadata-eval56.5%
\[\leadsto \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{\frac{i}{n}}
\]
Simplified56.5%
\[\leadsto \color{blue}{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{\frac{i}{n}}}
\]
Taylor expanded in n around inf 73.0%
\[\leadsto \frac{\color{blue}{100 \cdot e^{i} - 100}}{\frac{i}{n}}
\]
Taylor expanded in i around 0 32.7%
\[\leadsto \frac{\color{blue}{100} - 100}{\frac{i}{n}}
\]
if -1.06e-10 < i Initial program 23.4%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in i around 0 62.5%
\[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)}
\]
Step-by-step derivation associate-*r*62.6%
\[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right)
\]
*-commutative62.6%
\[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)
\]
associate-*r/62.6%
\[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)
\]
metadata-eval62.6%
\[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right)
\]
Simplified62.6%
\[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)}
\]
Taylor expanded in n around inf 63.0%
\[\leadsto 100 \cdot \left(n + \color{blue}{0.5 \cdot \left(n \cdot i\right)}\right)
\]
Step-by-step derivation *-commutative63.0%
\[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot 0.5}\right)
\]
associate-*r*63.0%
\[\leadsto 100 \cdot \left(n + \color{blue}{n \cdot \left(i \cdot 0.5\right)}\right)
\]
Simplified63.0%
\[\leadsto 100 \cdot \left(n + \color{blue}{n \cdot \left(i \cdot 0.5\right)}\right)
\]
Recombined 2 regimes into one program. Final simplification55.5%
\[\leadsto \begin{array}{l}
\mathbf{if}\;i \leq -1.06 \cdot 10^{-10}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n + n \cdot \left(i \cdot 0.5\right)\right)\\
\end{array}
\]
Alternative 13: 58.1% accurate, 12.6× speedup? \[\begin{array}{l}
\mathbf{if}\;i \leq 4.5 \cdot 10^{+31}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\
\end{array}
\]
Derivation Split input into 2 regimes if i < 4.4999999999999996e31 Initial program 25.0%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in i around 0 54.9%
\[\leadsto \color{blue}{100 \cdot n}
\]
Step-by-step derivation *-commutative54.9%
\[\leadsto \color{blue}{n \cdot 100}
\]
Simplified54.9%
\[\leadsto \color{blue}{n \cdot 100}
\]
if 4.4999999999999996e31 < i Initial program 52.7%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Step-by-step derivation associate-/r/53.0%
\[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)}
\]
associate-*r*53.0%
\[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n}
\]
*-commutative53.0%
\[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)}
\]
associate-*r/53.0%
\[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}}
\]
sub-neg53.0%
\[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i}
\]
distribute-lft-in53.0%
\[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i}
\]
fma-def53.0%
\[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i}
\]
metadata-eval53.0%
\[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i}
\]
metadata-eval53.0%
\[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i}
\]
Simplified53.0%
\[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}}
\]
Taylor expanded in i around 0 32.4%
\[\leadsto n \cdot \color{blue}{\left(100 + \left(100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)}
\]
Step-by-step derivation distribute-lft-out32.4%
\[\leadsto n \cdot \left(100 + \color{blue}{100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)}\right)
\]
associate-*r/32.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
metadata-eval32.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
unpow232.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \color{blue}{\left(i \cdot i\right)} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
associate--l+32.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)}\right)\right)
\]
associate-*r/32.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\color{blue}{\frac{0.3333333333333333 \cdot 1}{{n}^{2}}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)
\]
metadata-eval32.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{\color{blue}{0.3333333333333333}}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)
\]
unpow232.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{\color{blue}{n \cdot n}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)
\]
associate-*r/32.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)\right)\right)
\]
metadata-eval32.4%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{\color{blue}{0.5}}{n}\right)\right)\right)\right)
\]
Simplified32.4%
\[\leadsto n \cdot \color{blue}{\left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{0.5}{n}\right)\right)\right)\right)}
\]
Taylor expanded in n around inf 32.7%
\[\leadsto \color{blue}{n \cdot \left(100 + 100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right)\right)}
\]
Step-by-step derivation distribute-lft-in32.7%
\[\leadsto n \cdot \left(100 + \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + 100 \cdot \left(0.5 \cdot i\right)\right)}\right)
\]
associate-*r*32.7%
\[\leadsto n \cdot \left(100 + \left(\color{blue}{\left(100 \cdot 0.16666666666666666\right) \cdot {i}^{2}} + 100 \cdot \left(0.5 \cdot i\right)\right)\right)
\]
metadata-eval32.7%
\[\leadsto n \cdot \left(100 + \left(\color{blue}{16.666666666666668} \cdot {i}^{2} + 100 \cdot \left(0.5 \cdot i\right)\right)\right)
\]
unpow232.7%
\[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \color{blue}{\left(i \cdot i\right)} + 100 \cdot \left(0.5 \cdot i\right)\right)\right)
\]
associate-*r*32.7%
\[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{\left(100 \cdot 0.5\right) \cdot i}\right)\right)
\]
metadata-eval32.7%
\[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{50} \cdot i\right)\right)
\]
Simplified32.7%
\[\leadsto \color{blue}{n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + 50 \cdot i\right)\right)}
\]
Taylor expanded in i around inf 32.7%
\[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot {i}^{2}\right)}
\]
Step-by-step derivation unpow232.7%
\[\leadsto 16.666666666666668 \cdot \left(n \cdot \color{blue}{\left(i \cdot i\right)}\right)
\]
Simplified32.7%
\[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)}
\]
Recombined 2 regimes into one program. Final simplification49.6%
\[\leadsto \begin{array}{l}
\mathbf{if}\;i \leq 4.5 \cdot 10^{+31}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\
\end{array}
\]
Alternative 14: 61.2% accurate, 12.6× speedup? \[\begin{array}{l}
\mathbf{if}\;i \leq -1.06 \cdot 10^{-10}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\]
Derivation Split input into 2 regimes if i < -1.06e-10 Initial program 56.5%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Step-by-step derivation associate-*r/56.5%
\[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}}
\]
sub-neg56.5%
\[\leadsto \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{\frac{i}{n}}
\]
distribute-lft-in56.5%
\[\leadsto \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{\frac{i}{n}}
\]
fma-def56.5%
\[\leadsto \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{\frac{i}{n}}
\]
metadata-eval56.5%
\[\leadsto \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{\frac{i}{n}}
\]
metadata-eval56.5%
\[\leadsto \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{\frac{i}{n}}
\]
Simplified56.5%
\[\leadsto \color{blue}{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{\frac{i}{n}}}
\]
Taylor expanded in n around inf 73.0%
\[\leadsto \frac{\color{blue}{100 \cdot e^{i} - 100}}{\frac{i}{n}}
\]
Taylor expanded in i around 0 32.7%
\[\leadsto \frac{\color{blue}{100} - 100}{\frac{i}{n}}
\]
if -1.06e-10 < i Initial program 23.4%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Step-by-step derivation associate-/r/23.9%
\[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)}
\]
associate-*r*23.9%
\[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n}
\]
*-commutative23.9%
\[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)}
\]
associate-*r/23.9%
\[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}}
\]
sub-neg23.9%
\[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i}
\]
distribute-lft-in23.9%
\[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i}
\]
fma-def23.9%
\[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i}
\]
metadata-eval23.9%
\[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i}
\]
metadata-eval23.9%
\[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i}
\]
Simplified23.9%
\[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}}
\]
Taylor expanded in i around 0 59.3%
\[\leadsto n \cdot \color{blue}{\left(100 + \left(100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)}
\]
Step-by-step derivation distribute-lft-out59.3%
\[\leadsto n \cdot \left(100 + \color{blue}{100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)}\right)
\]
associate-*r/59.3%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
metadata-eval59.3%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
unpow259.3%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \color{blue}{\left(i \cdot i\right)} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)
\]
associate--l+59.3%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)}\right)\right)
\]
associate-*r/59.3%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\color{blue}{\frac{0.3333333333333333 \cdot 1}{{n}^{2}}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)
\]
metadata-eval59.3%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{\color{blue}{0.3333333333333333}}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)
\]
unpow259.3%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{\color{blue}{n \cdot n}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)
\]
associate-*r/59.3%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)\right)\right)
\]
metadata-eval59.3%
\[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{\color{blue}{0.5}}{n}\right)\right)\right)\right)
\]
Simplified59.3%
\[\leadsto n \cdot \color{blue}{\left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{0.5}{n}\right)\right)\right)\right)}
\]
Taylor expanded in n around inf 65.1%
\[\leadsto \color{blue}{n \cdot \left(100 + 100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right)\right)}
\]
Step-by-step derivation distribute-lft-in65.1%
\[\leadsto n \cdot \left(100 + \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + 100 \cdot \left(0.5 \cdot i\right)\right)}\right)
\]
associate-*r*65.1%
\[\leadsto n \cdot \left(100 + \left(\color{blue}{\left(100 \cdot 0.16666666666666666\right) \cdot {i}^{2}} + 100 \cdot \left(0.5 \cdot i\right)\right)\right)
\]
metadata-eval65.1%
\[\leadsto n \cdot \left(100 + \left(\color{blue}{16.666666666666668} \cdot {i}^{2} + 100 \cdot \left(0.5 \cdot i\right)\right)\right)
\]
unpow265.1%
\[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \color{blue}{\left(i \cdot i\right)} + 100 \cdot \left(0.5 \cdot i\right)\right)\right)
\]
associate-*r*65.1%
\[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{\left(100 \cdot 0.5\right) \cdot i}\right)\right)
\]
metadata-eval65.1%
\[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{50} \cdot i\right)\right)
\]
Simplified65.1%
\[\leadsto \color{blue}{n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + 50 \cdot i\right)\right)}
\]
Taylor expanded in i around 0 63.0%
\[\leadsto n \cdot \left(100 + \color{blue}{50 \cdot i}\right)
\]
Step-by-step derivation *-commutative63.0%
\[\leadsto n \cdot \left(100 + \color{blue}{i \cdot 50}\right)
\]
Simplified63.0%
\[\leadsto n \cdot \left(100 + \color{blue}{i \cdot 50}\right)
\]
Recombined 2 regimes into one program. Final simplification55.5%
\[\leadsto \begin{array}{l}
\mathbf{if}\;i \leq -1.06 \cdot 10^{-10}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\]
Alternative 15: 55.7% accurate, 16.1× speedup? \[\begin{array}{l}
\mathbf{if}\;i \leq 4.5 \cdot 10^{+31}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;50 \cdot \left(i \cdot n\right)\\
\end{array}
\]
Derivation Split input into 2 regimes if i < 4.4999999999999996e31 Initial program 25.0%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in i around 0 54.9%
\[\leadsto \color{blue}{100 \cdot n}
\]
Step-by-step derivation *-commutative54.9%
\[\leadsto \color{blue}{n \cdot 100}
\]
Simplified54.9%
\[\leadsto \color{blue}{n \cdot 100}
\]
if 4.4999999999999996e31 < i Initial program 52.7%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in i around 0 26.4%
\[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)}
\]
Step-by-step derivation associate-*r*26.4%
\[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right)
\]
*-commutative26.4%
\[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)
\]
associate-*r/26.4%
\[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)
\]
metadata-eval26.4%
\[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right)
\]
Simplified26.4%
\[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)}
\]
Taylor expanded in n around inf 26.8%
\[\leadsto 100 \cdot \color{blue}{\left(\left(1 + 0.5 \cdot i\right) \cdot n\right)}
\]
Taylor expanded in i around inf 26.8%
\[\leadsto \color{blue}{50 \cdot \left(n \cdot i\right)}
\]
Recombined 2 regimes into one program. Final simplification48.2%
\[\leadsto \begin{array}{l}
\mathbf{if}\;i \leq 4.5 \cdot 10^{+31}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;50 \cdot \left(i \cdot n\right)\\
\end{array}
\]
Alternative 16: 55.7% accurate, 16.1× speedup? \[\begin{array}{l}
\mathbf{if}\;i \leq 4.5 \cdot 10^{+31}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(i \cdot 50\right)\\
\end{array}
\]
Derivation Split input into 2 regimes if i < 4.4999999999999996e31 Initial program 25.0%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in i around 0 54.9%
\[\leadsto \color{blue}{100 \cdot n}
\]
Step-by-step derivation *-commutative54.9%
\[\leadsto \color{blue}{n \cdot 100}
\]
Simplified54.9%
\[\leadsto \color{blue}{n \cdot 100}
\]
if 4.4999999999999996e31 < i Initial program 52.7%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in i around 0 26.4%
\[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)}
\]
Step-by-step derivation associate-*r*26.4%
\[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right)
\]
*-commutative26.4%
\[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)
\]
associate-*r/26.4%
\[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)
\]
metadata-eval26.4%
\[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right)
\]
Simplified26.4%
\[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)}
\]
Taylor expanded in n around inf 26.8%
\[\leadsto 100 \cdot \color{blue}{\left(\left(1 + 0.5 \cdot i\right) \cdot n\right)}
\]
Taylor expanded in i around inf 26.8%
\[\leadsto \color{blue}{50 \cdot \left(n \cdot i\right)}
\]
Step-by-step derivation *-commutative26.8%
\[\leadsto \color{blue}{\left(n \cdot i\right) \cdot 50}
\]
associate-*l*26.8%
\[\leadsto \color{blue}{n \cdot \left(i \cdot 50\right)}
\]
Simplified26.8%
\[\leadsto \color{blue}{n \cdot \left(i \cdot 50\right)}
\]
Recombined 2 regimes into one program. Final simplification48.2%
\[\leadsto \begin{array}{l}
\mathbf{if}\;i \leq 4.5 \cdot 10^{+31}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(i \cdot 50\right)\\
\end{array}
\]
Alternative 17: 2.8% accurate, 38.0× speedup? \[i \cdot -50
\]
Derivation Initial program 31.6%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in i around 0 48.1%
\[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)}
\]
Step-by-step derivation associate-*r*48.2%
\[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right)
\]
*-commutative48.2%
\[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)
\]
associate-*r/48.2%
\[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)
\]
metadata-eval48.2%
\[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right)
\]
Simplified48.2%
\[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)}
\]
Taylor expanded in n around 0 2.6%
\[\leadsto \color{blue}{-50 \cdot i}
\]
Step-by-step derivation *-commutative2.6%
\[\leadsto \color{blue}{i \cdot -50}
\]
Simplified2.6%
\[\leadsto \color{blue}{i \cdot -50}
\]
Final simplification2.6%
\[\leadsto i \cdot -50
\]
Alternative 18: 50.5% accurate, 38.0× speedup? \[n \cdot 100
\]
Derivation Initial program 31.6%
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\]
Taylor expanded in i around 0 42.9%
\[\leadsto \color{blue}{100 \cdot n}
\]
Step-by-step derivation *-commutative42.9%
\[\leadsto \color{blue}{n \cdot 100}
\]
Simplified42.9%
\[\leadsto \color{blue}{n \cdot 100}
\]
Final simplification42.9%
\[\leadsto n \cdot 100
\]
Developer target: 33.2% accurate, 0.5× speedup? \[100 \cdot \frac{e^{n \cdot \begin{array}{l}
\mathbf{if}\;1 + \frac{i}{n} = 1:\\
\;\;\;\;\frac{i}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{i}{n} \cdot \log \left(1 + \frac{i}{n}\right)}{\left(\frac{i}{n} + 1\right) - 1}\\
\end{array}} - 1}{\frac{i}{n}}
\]
Reproduce ? herbie shell --seed 2023167
(FPCore (i n)
:name "Compound Interest"
:precision binary64
:herbie-target
(* 100.0 (/ (- (exp (* n (if (== (+ 1.0 (/ i n)) 1.0) (/ i n) (/ (* (/ i n) (log (+ 1.0 (/ i n)))) (- (+ (/ i n) 1.0) 1.0))))) 1.0) (/ i n)))
(* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))