Beckmann Distribution sample, tan2theta, alphax == alphay

Percentage Accurate: 56.0% → 98.9%
Time: 12.1s
Alternatives: 15
Speedup: 21.6×

Specification

?
\[\left(0.0001 \leq \alpha \land \alpha \leq 1\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\]
\[\begin{array}{l} \\ \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (* (* (- alpha) alpha) (log (- 1.0 u0))))
float code(float alpha, float u0) {
	return (-alpha * alpha) * logf((1.0f - u0));
}
real(4) function code(alpha, u0)
    real(4), intent (in) :: alpha
    real(4), intent (in) :: u0
    code = (-alpha * alpha) * log((1.0e0 - u0))
end function
function code(alpha, u0)
	return Float32(Float32(Float32(-alpha) * alpha) * log(Float32(Float32(1.0) - u0)))
end
function tmp = code(alpha, u0)
	tmp = (-alpha * alpha) * log((single(1.0) - u0));
end
\begin{array}{l}

\\
\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)
\end{array}

Sampling outcomes in binary32 precision:

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 15 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.

Initial Program: 56.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (* (* (- alpha) alpha) (log (- 1.0 u0))))
float code(float alpha, float u0) {
	return (-alpha * alpha) * logf((1.0f - u0));
}
real(4) function code(alpha, u0)
    real(4), intent (in) :: alpha
    real(4), intent (in) :: u0
    code = (-alpha * alpha) * log((1.0e0 - u0))
end function
function code(alpha, u0)
	return Float32(Float32(Float32(-alpha) * alpha) * log(Float32(Float32(1.0) - u0)))
end
function tmp = code(alpha, u0)
	tmp = (-alpha * alpha) * log((single(1.0) - u0));
end
\begin{array}{l}

\\
\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)
\end{array}

Alternative 1: 98.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \alpha \cdot \left(\left(-\alpha\right) \cdot \mathsf{log1p}\left(-u0\right)\right) \end{array} \]
(FPCore (alpha u0) :precision binary32 (* alpha (* (- alpha) (log1p (- u0)))))
float code(float alpha, float u0) {
	return alpha * (-alpha * log1pf(-u0));
}
function code(alpha, u0)
	return Float32(alpha * Float32(Float32(-alpha) * log1p(Float32(-u0))))
end
\begin{array}{l}

\\
\alpha \cdot \left(\left(-\alpha\right) \cdot \mathsf{log1p}\left(-u0\right)\right)
\end{array}
Derivation
  1. Initial program 52.0%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right), \color{blue}{\log \left(1 - u0\right)}\right) \]
    2. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    3. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\left(0 - \alpha \cdot \alpha\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    4. --lowering--.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \left(\alpha \cdot \alpha\right)\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    5. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \log \left(1 - \color{blue}{u0}\right)\right) \]
    6. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    7. log1p-defineN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \left(\mathsf{log1p}\left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    9. neg-lowering-neg.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(u0\right)\right)\right) \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{\left(0 - \alpha \cdot \alpha\right) \cdot \mathsf{log1p}\left(-u0\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    2. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    3. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha\right)\right), \alpha\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    4. neg-lowering-neg.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(\color{blue}{u0}\right)\right)\right) \]
  6. Applied egg-rr99.0%

    \[\leadsto \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right)} \cdot \mathsf{log1p}\left(-u0\right) \]
  7. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right)} \]
    2. associate-*r*N/A

      \[\leadsto \left(\log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right) \cdot \left(\mathsf{neg}\left(\alpha\right)\right)\right) \cdot \color{blue}{\alpha} \]
    3. distribute-rgt-neg-outN/A

      \[\leadsto \left(\mathsf{neg}\left(\log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right) \cdot \alpha\right)\right) \cdot \alpha \]
    4. *-commutativeN/A

      \[\leadsto \left(\mathsf{neg}\left(\alpha \cdot \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right)\right) \cdot \alpha \]
    5. distribute-lft-neg-outN/A

      \[\leadsto \left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right) \cdot \alpha \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right), \color{blue}{\alpha}\right) \]
    7. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha\right)\right), \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    8. neg-lowering-neg.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    9. log1p-defineN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \left(\mathsf{log1p}\left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    10. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    11. neg-lowering-neg.f3299.1%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(u0\right)\right)\right), \alpha\right) \]
  8. Applied egg-rr99.1%

    \[\leadsto \color{blue}{\left(\left(-\alpha\right) \cdot \mathsf{log1p}\left(-u0\right)\right) \cdot \alpha} \]
  9. Final simplification99.1%

    \[\leadsto \alpha \cdot \left(\left(-\alpha\right) \cdot \mathsf{log1p}\left(-u0\right)\right) \]
  10. Add Preprocessing

Alternative 2: 99.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \mathsf{log1p}\left(-u0\right) \cdot \left(0 - \alpha \cdot \alpha\right) \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (* (log1p (- u0)) (- 0.0 (* alpha alpha))))
float code(float alpha, float u0) {
	return log1pf(-u0) * (0.0f - (alpha * alpha));
}
function code(alpha, u0)
	return Float32(log1p(Float32(-u0)) * Float32(Float32(0.0) - Float32(alpha * alpha)))
end
\begin{array}{l}

\\
\mathsf{log1p}\left(-u0\right) \cdot \left(0 - \alpha \cdot \alpha\right)
\end{array}
Derivation
  1. Initial program 52.0%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right), \color{blue}{\log \left(1 - u0\right)}\right) \]
    2. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    3. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\left(0 - \alpha \cdot \alpha\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    4. --lowering--.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \left(\alpha \cdot \alpha\right)\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    5. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \log \left(1 - \color{blue}{u0}\right)\right) \]
    6. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    7. log1p-defineN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \left(\mathsf{log1p}\left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    9. neg-lowering-neg.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(u0\right)\right)\right) \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{\left(0 - \alpha \cdot \alpha\right) \cdot \mathsf{log1p}\left(-u0\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    2. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    3. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha\right)\right), \alpha\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    4. neg-lowering-neg.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(\color{blue}{u0}\right)\right)\right) \]
  6. Applied egg-rr99.0%

    \[\leadsto \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right)} \cdot \mathsf{log1p}\left(-u0\right) \]
  7. Final simplification99.0%

    \[\leadsto \mathsf{log1p}\left(-u0\right) \cdot \left(0 - \alpha \cdot \alpha\right) \]
  8. Add Preprocessing

Alternative 3: 93.9% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\\ \frac{\left(1 - t\_0 \cdot \left(u0 \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right)\right)\right) \cdot \left(\alpha \cdot \left(\alpha \cdot u0\right)\right)}{t\_0 - -1} \end{array} \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (let* ((t_0 (* u0 (+ -0.5 (* u0 (+ -0.3333333333333333 (* u0 -0.25)))))))
   (/
    (*
     (- 1.0 (* t_0 (* u0 (+ -0.5 (* u0 -0.3333333333333333)))))
     (* alpha (* alpha u0)))
    (- t_0 -1.0))))
float code(float alpha, float u0) {
	float t_0 = u0 * (-0.5f + (u0 * (-0.3333333333333333f + (u0 * -0.25f))));
	return ((1.0f - (t_0 * (u0 * (-0.5f + (u0 * -0.3333333333333333f))))) * (alpha * (alpha * u0))) / (t_0 - -1.0f);
}
real(4) function code(alpha, u0)
    real(4), intent (in) :: alpha
    real(4), intent (in) :: u0
    real(4) :: t_0
    t_0 = u0 * ((-0.5e0) + (u0 * ((-0.3333333333333333e0) + (u0 * (-0.25e0)))))
    code = ((1.0e0 - (t_0 * (u0 * ((-0.5e0) + (u0 * (-0.3333333333333333e0)))))) * (alpha * (alpha * u0))) / (t_0 - (-1.0e0))
end function
function code(alpha, u0)
	t_0 = Float32(u0 * Float32(Float32(-0.5) + Float32(u0 * Float32(Float32(-0.3333333333333333) + Float32(u0 * Float32(-0.25))))))
	return Float32(Float32(Float32(Float32(1.0) - Float32(t_0 * Float32(u0 * Float32(Float32(-0.5) + Float32(u0 * Float32(-0.3333333333333333)))))) * Float32(alpha * Float32(alpha * u0))) / Float32(t_0 - Float32(-1.0)))
end
function tmp = code(alpha, u0)
	t_0 = u0 * (single(-0.5) + (u0 * (single(-0.3333333333333333) + (u0 * single(-0.25)))));
	tmp = ((single(1.0) - (t_0 * (u0 * (single(-0.5) + (u0 * single(-0.3333333333333333)))))) * (alpha * (alpha * u0))) / (t_0 - single(-1.0));
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\\
\frac{\left(1 - t\_0 \cdot \left(u0 \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right)\right)\right) \cdot \left(\alpha \cdot \left(\alpha \cdot u0\right)\right)}{t\_0 - -1}
\end{array}
\end{array}
Derivation
  1. Initial program 52.0%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Add Preprocessing
  3. Taylor expanded in u0 around 0

    \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right) - 1\right)\right)}\right) \]
  4. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right) - 1\right)}\right)\right) \]
    2. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right) + -1\right)\right)\right) \]
    4. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \left(-1 + \color{blue}{u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)}\right)\right)\right) \]
    5. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)\right)}\right)\right)\right) \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \color{blue}{\left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)}\right)\right)\right)\right) \]
    7. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) + \frac{-1}{2}\right)\right)\right)\right)\right) \]
    9. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{2} + \color{blue}{u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
    10. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \color{blue}{\left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right)\right)}\right)\right)\right)\right)\right) \]
    11. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \color{blue}{\left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right)}\right)\right)\right)\right)\right)\right) \]
    12. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \left(\frac{-1}{4} \cdot u0 + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}\right)\right)\right)\right)\right)\right)\right) \]
    13. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \left(\frac{-1}{4} \cdot u0 + \frac{-1}{3}\right)\right)\right)\right)\right)\right)\right) \]
    14. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} + \color{blue}{\frac{-1}{4} \cdot u0}\right)\right)\right)\right)\right)\right)\right) \]
    15. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \color{blue}{\left(\frac{-1}{4} \cdot u0\right)}\right)\right)\right)\right)\right)\right)\right) \]
    16. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \left(u0 \cdot \color{blue}{\frac{-1}{4}}\right)\right)\right)\right)\right)\right)\right)\right) \]
    17. *-lowering-*.f3294.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \color{blue}{\frac{-1}{4}}\right)\right)\right)\right)\right)\right)\right)\right) \]
  5. Simplified94.0%

    \[\leadsto \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \color{blue}{\left(u0 \cdot \left(-1 + u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\right)\right)} \]
  6. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot u0\right) \cdot \color{blue}{\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)} \]
    2. *-commutativeN/A

      \[\leadsto \left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right) \cdot \color{blue}{\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot u0\right)} \]
    3. distribute-lft-neg-outN/A

      \[\leadsto \left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right) \cdot u0\right) \]
    4. distribute-lft-neg-outN/A

      \[\leadsto \left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\alpha \cdot \alpha\right) \cdot u0\right)\right) \]
    5. *-commutativeN/A

      \[\leadsto \left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right) \cdot \left(\mathsf{neg}\left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right) \]
    6. distribute-rgt-neg-outN/A

      \[\leadsto \mathsf{neg}\left(\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right) \]
    7. neg-lowering-neg.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\left(\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
    8. *-lowering-*.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right), \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
    9. +-lowering-+.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \left(u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)\right), \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
    10. *-lowering-*.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)\right), \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
    11. +-lowering-+.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \left(u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)\right)\right), \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
    12. *-lowering-*.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)\right)\right), \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
    13. +-lowering-+.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \left(u0 \cdot \frac{-1}{4}\right)\right)\right)\right)\right)\right), \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
    14. *-lowering-*.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right)\right), \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
    15. *-lowering-*.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(u0, \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
  7. Applied egg-rr93.9%

    \[\leadsto \color{blue}{-\left(-1 + u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)} \]
  8. Step-by-step derivation
    1. flip-+N/A

      \[\leadsto \mathsf{neg.f32}\left(\left(\frac{-1 \cdot -1 - \left(u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right) \cdot \left(u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)}{-1 - u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)} \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
    2. associate-*l/N/A

      \[\leadsto \mathsf{neg.f32}\left(\left(\frac{\left(-1 \cdot -1 - \left(u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right) \cdot \left(u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)}{-1 - u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)}\right)\right) \]
    3. /-lowering-/.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{/.f32}\left(\left(\left(-1 \cdot -1 - \left(u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right) \cdot \left(u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right), \left(-1 - u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)\right)\right) \]
  9. Applied egg-rr94.2%

    \[\leadsto -\color{blue}{\frac{\left(1 - \left(u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\right) \cdot \left(u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\right)\right) \cdot \left(\alpha \cdot \left(\alpha \cdot u0\right)\right)}{-1 - u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)}} \]
  10. Taylor expanded in u0 around 0

    \[\leadsto \mathsf{neg.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right), \color{blue}{\left(u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right)\right)}\right)\right), \mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(\alpha, u0\right)\right)\right), \mathsf{\_.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right)\right)\right)\right) \]
  11. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(\alpha, u0\right)\right)\right), \mathsf{\_.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right)\right)\right)\right) \]
    2. sub-negN/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} \cdot u0 + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(\alpha, u0\right)\right)\right), \mathsf{\_.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right)\right)\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} \cdot u0 + \frac{-1}{2}\right)\right)\right)\right), \mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(\alpha, u0\right)\right)\right), \mathsf{\_.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right)\right)\right)\right) \]
    4. +-commutativeN/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(u0, \left(\frac{-1}{2} + \frac{-1}{3} \cdot u0\right)\right)\right)\right), \mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(\alpha, u0\right)\right)\right), \mathsf{\_.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right)\right)\right)\right) \]
    5. +-lowering-+.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \left(\frac{-1}{3} \cdot u0\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(\alpha, u0\right)\right)\right), \mathsf{\_.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right)\right)\right)\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \left(u0 \cdot \frac{-1}{3}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(\alpha, u0\right)\right)\right), \mathsf{\_.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right)\right)\right)\right) \]
    7. *-lowering-*.f3294.6%

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \frac{-1}{3}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(\alpha, u0\right)\right)\right), \mathsf{\_.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right)\right)\right)\right) \]
  12. Simplified94.6%

    \[\leadsto -\frac{\left(1 - \left(u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\right) \cdot \color{blue}{\left(u0 \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(\alpha \cdot \left(\alpha \cdot u0\right)\right)}{-1 - u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)} \]
  13. Final simplification94.6%

    \[\leadsto \frac{\left(1 - \left(u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\right) \cdot \left(u0 \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right)\right)\right) \cdot \left(\alpha \cdot \left(\alpha \cdot u0\right)\right)}{u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right) - -1} \]
  14. Add Preprocessing

Alternative 4: 93.2% accurate, 4.7× speedup?

\[\begin{array}{l} \\ \alpha \cdot \left(\alpha \cdot u0\right) - \left(u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (-
  (* alpha (* alpha u0))
  (*
   (* u0 (+ -0.5 (* u0 (+ -0.3333333333333333 (* u0 -0.25)))))
   (* u0 (* alpha alpha)))))
float code(float alpha, float u0) {
	return (alpha * (alpha * u0)) - ((u0 * (-0.5f + (u0 * (-0.3333333333333333f + (u0 * -0.25f))))) * (u0 * (alpha * alpha)));
}
real(4) function code(alpha, u0)
    real(4), intent (in) :: alpha
    real(4), intent (in) :: u0
    code = (alpha * (alpha * u0)) - ((u0 * ((-0.5e0) + (u0 * ((-0.3333333333333333e0) + (u0 * (-0.25e0)))))) * (u0 * (alpha * alpha)))
end function
function code(alpha, u0)
	return Float32(Float32(alpha * Float32(alpha * u0)) - Float32(Float32(u0 * Float32(Float32(-0.5) + Float32(u0 * Float32(Float32(-0.3333333333333333) + Float32(u0 * Float32(-0.25)))))) * Float32(u0 * Float32(alpha * alpha))))
end
function tmp = code(alpha, u0)
	tmp = (alpha * (alpha * u0)) - ((u0 * (single(-0.5) + (u0 * (single(-0.3333333333333333) + (u0 * single(-0.25)))))) * (u0 * (alpha * alpha)));
end
\begin{array}{l}

\\
\alpha \cdot \left(\alpha \cdot u0\right) - \left(u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)
\end{array}
Derivation
  1. Initial program 52.0%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Add Preprocessing
  3. Taylor expanded in u0 around 0

    \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right) - 1\right)\right)}\right) \]
  4. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right) - 1\right)}\right)\right) \]
    2. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right) + -1\right)\right)\right) \]
    4. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \left(-1 + \color{blue}{u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)}\right)\right)\right) \]
    5. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)\right)}\right)\right)\right) \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \color{blue}{\left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)}\right)\right)\right)\right) \]
    7. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) + \frac{-1}{2}\right)\right)\right)\right)\right) \]
    9. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{2} + \color{blue}{u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
    10. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \color{blue}{\left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right)\right)}\right)\right)\right)\right)\right) \]
    11. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \color{blue}{\left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right)}\right)\right)\right)\right)\right)\right) \]
    12. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \left(\frac{-1}{4} \cdot u0 + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}\right)\right)\right)\right)\right)\right)\right) \]
    13. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \left(\frac{-1}{4} \cdot u0 + \frac{-1}{3}\right)\right)\right)\right)\right)\right)\right) \]
    14. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} + \color{blue}{\frac{-1}{4} \cdot u0}\right)\right)\right)\right)\right)\right)\right) \]
    15. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \color{blue}{\left(\frac{-1}{4} \cdot u0\right)}\right)\right)\right)\right)\right)\right)\right) \]
    16. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \left(u0 \cdot \color{blue}{\frac{-1}{4}}\right)\right)\right)\right)\right)\right)\right)\right) \]
    17. *-lowering-*.f3294.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \color{blue}{\frac{-1}{4}}\right)\right)\right)\right)\right)\right)\right)\right) \]
  5. Simplified94.0%

    \[\leadsto \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \color{blue}{\left(u0 \cdot \left(-1 + u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\right)\right)} \]
  6. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot u0\right) \cdot \color{blue}{\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)} \]
    2. +-commutativeN/A

      \[\leadsto \left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot u0\right) \cdot \left(u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right) + \color{blue}{-1}\right) \]
    3. distribute-lft-inN/A

      \[\leadsto \left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot u0\right) \cdot \left(u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right) + \color{blue}{\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot u0\right) \cdot -1} \]
    4. +-lowering-+.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\left(\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot u0\right) \cdot \left(u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)\right), \color{blue}{\left(\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot u0\right) \cdot -1\right)}\right) \]
  7. Applied egg-rr94.1%

    \[\leadsto \color{blue}{\left(\left(0 - \alpha \cdot \alpha\right) \cdot u0\right) \cdot \left(u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\right) + \left(\left(0 - \alpha \cdot \alpha\right) \cdot u0\right) \cdot -1} \]
  8. Taylor expanded in alpha around 0

    \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), u0\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right)\right), \color{blue}{\left({\alpha}^{2} \cdot u0\right)}\right) \]
  9. Step-by-step derivation
    1. unpow2N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), u0\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right)\right), \left(\left(\alpha \cdot \alpha\right) \cdot u0\right)\right) \]
    2. associate-*l*N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), u0\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right)\right), \left(\alpha \cdot \color{blue}{\left(\alpha \cdot u0\right)}\right)\right) \]
    3. *-lowering-*.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), u0\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\alpha, \color{blue}{\left(\alpha \cdot u0\right)}\right)\right) \]
    4. *-lowering-*.f3294.3%

      \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), u0\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(\alpha, \color{blue}{u0}\right)\right)\right) \]
  10. Simplified94.3%

    \[\leadsto \left(\left(0 - \alpha \cdot \alpha\right) \cdot u0\right) \cdot \left(u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\right) + \color{blue}{\alpha \cdot \left(\alpha \cdot u0\right)} \]
  11. Final simplification94.3%

    \[\leadsto \alpha \cdot \left(\alpha \cdot u0\right) - \left(u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \]
  12. Add Preprocessing

Alternative 5: 93.2% accurate, 4.7× speedup?

\[\begin{array}{l} \\ u0 \cdot \left(\alpha \cdot \alpha + \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(\left(u0 \cdot u0\right) \cdot 0.25 + \left(0.5 + u0 \cdot 0.3333333333333333\right)\right)\right) \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (*
  u0
  (+
   (* alpha alpha)
   (*
    (* u0 (* alpha alpha))
    (+ (* (* u0 u0) 0.25) (+ 0.5 (* u0 0.3333333333333333)))))))
float code(float alpha, float u0) {
	return u0 * ((alpha * alpha) + ((u0 * (alpha * alpha)) * (((u0 * u0) * 0.25f) + (0.5f + (u0 * 0.3333333333333333f)))));
}
real(4) function code(alpha, u0)
    real(4), intent (in) :: alpha
    real(4), intent (in) :: u0
    code = u0 * ((alpha * alpha) + ((u0 * (alpha * alpha)) * (((u0 * u0) * 0.25e0) + (0.5e0 + (u0 * 0.3333333333333333e0)))))
end function
function code(alpha, u0)
	return Float32(u0 * Float32(Float32(alpha * alpha) + Float32(Float32(u0 * Float32(alpha * alpha)) * Float32(Float32(Float32(u0 * u0) * Float32(0.25)) + Float32(Float32(0.5) + Float32(u0 * Float32(0.3333333333333333)))))))
end
function tmp = code(alpha, u0)
	tmp = u0 * ((alpha * alpha) + ((u0 * (alpha * alpha)) * (((u0 * u0) * single(0.25)) + (single(0.5) + (u0 * single(0.3333333333333333))))));
end
\begin{array}{l}

\\
u0 \cdot \left(\alpha \cdot \alpha + \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(\left(u0 \cdot u0\right) \cdot 0.25 + \left(0.5 + u0 \cdot 0.3333333333333333\right)\right)\right)
\end{array}
Derivation
  1. Initial program 52.0%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Add Preprocessing
  3. Taylor expanded in u0 around 0

    \[\leadsto \color{blue}{u0 \cdot \left(u0 \cdot \left(\frac{1}{2} \cdot {\alpha}^{2} + u0 \cdot \left(\frac{1}{4} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{3} \cdot {\alpha}^{2}\right)\right) + {\alpha}^{2}\right)} \]
  4. Simplified94.2%

    \[\leadsto \color{blue}{u0 \cdot \left(\alpha \cdot \alpha + \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(\left(u0 \cdot u0\right) \cdot 0.25 + \left(0.5 + u0 \cdot 0.3333333333333333\right)\right)\right)} \]
  5. Add Preprocessing

Alternative 6: 93.2% accurate, 5.7× speedup?

\[\begin{array}{l} \\ \left(\alpha \cdot \alpha\right) \cdot \left(u0 - \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right) \cdot \left(u0 \cdot u0\right)\right) \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (*
  (* alpha alpha)
  (- u0 (* (+ -0.5 (* u0 (+ -0.3333333333333333 (* u0 -0.25)))) (* u0 u0)))))
float code(float alpha, float u0) {
	return (alpha * alpha) * (u0 - ((-0.5f + (u0 * (-0.3333333333333333f + (u0 * -0.25f)))) * (u0 * u0)));
}
real(4) function code(alpha, u0)
    real(4), intent (in) :: alpha
    real(4), intent (in) :: u0
    code = (alpha * alpha) * (u0 - (((-0.5e0) + (u0 * ((-0.3333333333333333e0) + (u0 * (-0.25e0))))) * (u0 * u0)))
end function
function code(alpha, u0)
	return Float32(Float32(alpha * alpha) * Float32(u0 - Float32(Float32(Float32(-0.5) + Float32(u0 * Float32(Float32(-0.3333333333333333) + Float32(u0 * Float32(-0.25))))) * Float32(u0 * u0))))
end
function tmp = code(alpha, u0)
	tmp = (alpha * alpha) * (u0 - ((single(-0.5) + (u0 * (single(-0.3333333333333333) + (u0 * single(-0.25))))) * (u0 * u0)));
end
\begin{array}{l}

\\
\left(\alpha \cdot \alpha\right) \cdot \left(u0 - \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right) \cdot \left(u0 \cdot u0\right)\right)
\end{array}
Derivation
  1. Initial program 52.0%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Add Preprocessing
  3. Taylor expanded in u0 around 0

    \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right) - 1\right)\right)}\right) \]
  4. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right) - 1\right)}\right)\right) \]
    2. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right) + -1\right)\right)\right) \]
    4. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \left(-1 + \color{blue}{u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)}\right)\right)\right) \]
    5. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)\right)}\right)\right)\right) \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \color{blue}{\left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)}\right)\right)\right)\right) \]
    7. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) + \frac{-1}{2}\right)\right)\right)\right)\right) \]
    9. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{2} + \color{blue}{u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
    10. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \color{blue}{\left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right)\right)}\right)\right)\right)\right)\right) \]
    11. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \color{blue}{\left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right)}\right)\right)\right)\right)\right)\right) \]
    12. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \left(\frac{-1}{4} \cdot u0 + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}\right)\right)\right)\right)\right)\right)\right) \]
    13. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \left(\frac{-1}{4} \cdot u0 + \frac{-1}{3}\right)\right)\right)\right)\right)\right)\right) \]
    14. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} + \color{blue}{\frac{-1}{4} \cdot u0}\right)\right)\right)\right)\right)\right)\right) \]
    15. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \color{blue}{\left(\frac{-1}{4} \cdot u0\right)}\right)\right)\right)\right)\right)\right)\right) \]
    16. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \left(u0 \cdot \color{blue}{\frac{-1}{4}}\right)\right)\right)\right)\right)\right)\right)\right) \]
    17. *-lowering-*.f3294.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \color{blue}{\frac{-1}{4}}\right)\right)\right)\right)\right)\right)\right)\right) \]
  5. Simplified94.0%

    \[\leadsto \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \color{blue}{\left(u0 \cdot \left(-1 + u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\right)\right)} \]
  6. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot u0\right) \cdot \color{blue}{\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)} \]
    2. +-commutativeN/A

      \[\leadsto \left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot u0\right) \cdot \left(u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right) + \color{blue}{-1}\right) \]
    3. distribute-lft-inN/A

      \[\leadsto \left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot u0\right) \cdot \left(u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right) + \color{blue}{\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot u0\right) \cdot -1} \]
    4. +-lowering-+.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\left(\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot u0\right) \cdot \left(u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)\right), \color{blue}{\left(\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot u0\right) \cdot -1\right)}\right) \]
  7. Applied egg-rr94.1%

    \[\leadsto \color{blue}{\left(\left(0 - \alpha \cdot \alpha\right) \cdot u0\right) \cdot \left(u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\right) + \left(\left(0 - \alpha \cdot \alpha\right) \cdot u0\right) \cdot -1} \]
  8. Taylor expanded in alpha around 0

    \[\leadsto \color{blue}{{\alpha}^{2} \cdot \left(u0 + -1 \cdot \left({u0}^{2} \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)\right)\right)} \]
  9. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left({\alpha}^{2}\right), \color{blue}{\left(u0 + -1 \cdot \left({u0}^{2} \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)\right)\right)}\right) \]
    2. unpow2N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\alpha \cdot \alpha\right), \left(\color{blue}{u0} + -1 \cdot \left({u0}^{2} \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)\right)\right)\right) \]
    3. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \left(\color{blue}{u0} + -1 \cdot \left({u0}^{2} \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)\right)\right)\right) \]
    4. mul-1-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \left(u0 + \left(\mathsf{neg}\left({u0}^{2} \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)\right)\right)\right)\right) \]
    5. unsub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \left(u0 - \color{blue}{{u0}^{2} \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)}\right)\right) \]
    6. --lowering--.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{\_.f32}\left(u0, \color{blue}{\left({u0}^{2} \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)\right)}\right)\right) \]
    7. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{\_.f32}\left(u0, \mathsf{*.f32}\left(\left({u0}^{2}\right), \color{blue}{\left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)}\right)\right)\right) \]
    8. unpow2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{\_.f32}\left(u0, \mathsf{*.f32}\left(\left(u0 \cdot u0\right), \left(\color{blue}{u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right)} - \frac{1}{2}\right)\right)\right)\right) \]
    9. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{\_.f32}\left(u0, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, u0\right), \left(\color{blue}{u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right)} - \frac{1}{2}\right)\right)\right)\right) \]
    10. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{\_.f32}\left(u0, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, u0\right), \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{\_.f32}\left(u0, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, u0\right), \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) + \frac{-1}{2}\right)\right)\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{\_.f32}\left(u0, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, u0\right), \left(\frac{-1}{2} + \color{blue}{u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right)}\right)\right)\right)\right) \]
    13. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{\_.f32}\left(u0, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, u0\right), \mathsf{+.f32}\left(\frac{-1}{2}, \color{blue}{\left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right)\right)}\right)\right)\right)\right) \]
    14. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{\_.f32}\left(u0, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, u0\right), \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \color{blue}{\left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
    15. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{\_.f32}\left(u0, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, u0\right), \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \left(\frac{-1}{4} \cdot u0 + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}\right)\right)\right)\right)\right)\right) \]
    16. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{\_.f32}\left(u0, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, u0\right), \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \left(\frac{-1}{4} \cdot u0 + \frac{-1}{3}\right)\right)\right)\right)\right)\right) \]
    17. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{\_.f32}\left(u0, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, u0\right), \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} + \color{blue}{\frac{-1}{4} \cdot u0}\right)\right)\right)\right)\right)\right) \]
    18. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{\_.f32}\left(u0, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, u0\right), \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \color{blue}{\left(\frac{-1}{4} \cdot u0\right)}\right)\right)\right)\right)\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{\_.f32}\left(u0, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, u0\right), \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \left(u0 \cdot \color{blue}{\frac{-1}{4}}\right)\right)\right)\right)\right)\right)\right) \]
    20. *-lowering-*.f3294.2%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{\_.f32}\left(u0, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, u0\right), \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \color{blue}{\frac{-1}{4}}\right)\right)\right)\right)\right)\right)\right) \]
  10. Simplified94.2%

    \[\leadsto \color{blue}{\left(\alpha \cdot \alpha\right) \cdot \left(u0 - \left(u0 \cdot u0\right) \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\right)} \]
  11. Final simplification94.2%

    \[\leadsto \left(\alpha \cdot \alpha\right) \cdot \left(u0 - \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right) \cdot \left(u0 \cdot u0\right)\right) \]
  12. Add Preprocessing

Alternative 7: 91.3% accurate, 6.4× speedup?

\[\begin{array}{l} \\ \alpha \cdot \left(u0 \cdot \left(\alpha + u0 \cdot \left(\alpha \cdot \left(u0 \cdot 0.3333333333333333\right) + \alpha \cdot 0.5\right)\right)\right) \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (*
  alpha
  (*
   u0
   (+ alpha (* u0 (+ (* alpha (* u0 0.3333333333333333)) (* alpha 0.5)))))))
float code(float alpha, float u0) {
	return alpha * (u0 * (alpha + (u0 * ((alpha * (u0 * 0.3333333333333333f)) + (alpha * 0.5f)))));
}
real(4) function code(alpha, u0)
    real(4), intent (in) :: alpha
    real(4), intent (in) :: u0
    code = alpha * (u0 * (alpha + (u0 * ((alpha * (u0 * 0.3333333333333333e0)) + (alpha * 0.5e0)))))
end function
function code(alpha, u0)
	return Float32(alpha * Float32(u0 * Float32(alpha + Float32(u0 * Float32(Float32(alpha * Float32(u0 * Float32(0.3333333333333333))) + Float32(alpha * Float32(0.5)))))))
end
function tmp = code(alpha, u0)
	tmp = alpha * (u0 * (alpha + (u0 * ((alpha * (u0 * single(0.3333333333333333))) + (alpha * single(0.5))))));
end
\begin{array}{l}

\\
\alpha \cdot \left(u0 \cdot \left(\alpha + u0 \cdot \left(\alpha \cdot \left(u0 \cdot 0.3333333333333333\right) + \alpha \cdot 0.5\right)\right)\right)
\end{array}
Derivation
  1. Initial program 52.0%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right), \color{blue}{\log \left(1 - u0\right)}\right) \]
    2. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    3. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\left(0 - \alpha \cdot \alpha\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    4. --lowering--.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \left(\alpha \cdot \alpha\right)\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    5. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \log \left(1 - \color{blue}{u0}\right)\right) \]
    6. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    7. log1p-defineN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \left(\mathsf{log1p}\left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    9. neg-lowering-neg.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(u0\right)\right)\right) \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{\left(0 - \alpha \cdot \alpha\right) \cdot \mathsf{log1p}\left(-u0\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    2. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    3. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha\right)\right), \alpha\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    4. neg-lowering-neg.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(\color{blue}{u0}\right)\right)\right) \]
  6. Applied egg-rr99.0%

    \[\leadsto \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right)} \cdot \mathsf{log1p}\left(-u0\right) \]
  7. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right)} \]
    2. associate-*r*N/A

      \[\leadsto \left(\log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right) \cdot \left(\mathsf{neg}\left(\alpha\right)\right)\right) \cdot \color{blue}{\alpha} \]
    3. distribute-rgt-neg-outN/A

      \[\leadsto \left(\mathsf{neg}\left(\log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right) \cdot \alpha\right)\right) \cdot \alpha \]
    4. *-commutativeN/A

      \[\leadsto \left(\mathsf{neg}\left(\alpha \cdot \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right)\right) \cdot \alpha \]
    5. distribute-lft-neg-outN/A

      \[\leadsto \left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right) \cdot \alpha \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right), \color{blue}{\alpha}\right) \]
    7. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha\right)\right), \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    8. neg-lowering-neg.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    9. log1p-defineN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \left(\mathsf{log1p}\left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    10. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    11. neg-lowering-neg.f3299.1%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(u0\right)\right)\right), \alpha\right) \]
  8. Applied egg-rr99.1%

    \[\leadsto \color{blue}{\left(\left(-\alpha\right) \cdot \mathsf{log1p}\left(-u0\right)\right) \cdot \alpha} \]
  9. Taylor expanded in u0 around 0

    \[\leadsto \mathsf{*.f32}\left(\color{blue}{\left(u0 \cdot \left(\alpha + u0 \cdot \left(\frac{1}{3} \cdot \left(\alpha \cdot u0\right) + \frac{1}{2} \cdot \alpha\right)\right)\right)}, \alpha\right) \]
  10. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \left(\alpha + u0 \cdot \left(\frac{1}{3} \cdot \left(\alpha \cdot u0\right) + \frac{1}{2} \cdot \alpha\right)\right)\right), \alpha\right) \]
    2. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \left(u0 \cdot \left(\frac{1}{3} \cdot \left(\alpha \cdot u0\right) + \frac{1}{2} \cdot \alpha\right)\right)\right)\right), \alpha\right) \]
    3. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \left(\frac{1}{3} \cdot \left(\alpha \cdot u0\right) + \frac{1}{2} \cdot \alpha\right)\right)\right)\right), \alpha\right) \]
    4. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\left(\frac{1}{3} \cdot \left(\alpha \cdot u0\right)\right), \left(\frac{1}{2} \cdot \alpha\right)\right)\right)\right)\right), \alpha\right) \]
    5. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\left(\left(\alpha \cdot u0\right) \cdot \frac{1}{3}\right), \left(\frac{1}{2} \cdot \alpha\right)\right)\right)\right)\right), \alpha\right) \]
    6. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\left(\alpha \cdot \left(u0 \cdot \frac{1}{3}\right)\right), \left(\frac{1}{2} \cdot \alpha\right)\right)\right)\right)\right), \alpha\right) \]
    7. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\left(\alpha \cdot \left(\frac{1}{3} \cdot u0\right)\right), \left(\frac{1}{2} \cdot \alpha\right)\right)\right)\right)\right), \alpha\right) \]
    8. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \left(\frac{1}{3} \cdot u0\right)\right), \left(\frac{1}{2} \cdot \alpha\right)\right)\right)\right)\right), \alpha\right) \]
    9. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \left(u0 \cdot \frac{1}{3}\right)\right), \left(\frac{1}{2} \cdot \alpha\right)\right)\right)\right)\right), \alpha\right) \]
    10. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \frac{1}{3}\right)\right), \left(\frac{1}{2} \cdot \alpha\right)\right)\right)\right)\right), \alpha\right) \]
    11. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \frac{1}{3}\right)\right), \left(\alpha \cdot \frac{1}{2}\right)\right)\right)\right)\right), \alpha\right) \]
    12. *-lowering-*.f3292.8%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \frac{1}{3}\right)\right), \mathsf{*.f32}\left(\alpha, \frac{1}{2}\right)\right)\right)\right)\right), \alpha\right) \]
  11. Simplified92.8%

    \[\leadsto \color{blue}{\left(u0 \cdot \left(\alpha + u0 \cdot \left(\alpha \cdot \left(u0 \cdot 0.3333333333333333\right) + \alpha \cdot 0.5\right)\right)\right)} \cdot \alpha \]
  12. Final simplification92.8%

    \[\leadsto \alpha \cdot \left(u0 \cdot \left(\alpha + u0 \cdot \left(\alpha \cdot \left(u0 \cdot 0.3333333333333333\right) + \alpha \cdot 0.5\right)\right)\right) \]
  13. Add Preprocessing

Alternative 8: 91.3% accurate, 6.4× speedup?

\[\begin{array}{l} \\ u0 \cdot \left(\alpha \cdot \alpha + \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(0.5 + u0 \cdot 0.3333333333333333\right)\right) \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (*
  u0
  (+
   (* alpha alpha)
   (* (* u0 (* alpha alpha)) (+ 0.5 (* u0 0.3333333333333333))))))
float code(float alpha, float u0) {
	return u0 * ((alpha * alpha) + ((u0 * (alpha * alpha)) * (0.5f + (u0 * 0.3333333333333333f))));
}
real(4) function code(alpha, u0)
    real(4), intent (in) :: alpha
    real(4), intent (in) :: u0
    code = u0 * ((alpha * alpha) + ((u0 * (alpha * alpha)) * (0.5e0 + (u0 * 0.3333333333333333e0))))
end function
function code(alpha, u0)
	return Float32(u0 * Float32(Float32(alpha * alpha) + Float32(Float32(u0 * Float32(alpha * alpha)) * Float32(Float32(0.5) + Float32(u0 * Float32(0.3333333333333333))))))
end
function tmp = code(alpha, u0)
	tmp = u0 * ((alpha * alpha) + ((u0 * (alpha * alpha)) * (single(0.5) + (u0 * single(0.3333333333333333)))));
end
\begin{array}{l}

\\
u0 \cdot \left(\alpha \cdot \alpha + \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(0.5 + u0 \cdot 0.3333333333333333\right)\right)
\end{array}
Derivation
  1. Initial program 52.0%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right), \color{blue}{\log \left(1 - u0\right)}\right) \]
    2. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    3. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\left(0 - \alpha \cdot \alpha\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    4. --lowering--.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \left(\alpha \cdot \alpha\right)\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    5. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \log \left(1 - \color{blue}{u0}\right)\right) \]
    6. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    7. log1p-defineN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \left(\mathsf{log1p}\left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    9. neg-lowering-neg.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(u0\right)\right)\right) \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{\left(0 - \alpha \cdot \alpha\right) \cdot \mathsf{log1p}\left(-u0\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    2. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    3. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha\right)\right), \alpha\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    4. neg-lowering-neg.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(\color{blue}{u0}\right)\right)\right) \]
  6. Applied egg-rr99.0%

    \[\leadsto \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right)} \cdot \mathsf{log1p}\left(-u0\right) \]
  7. Taylor expanded in u0 around 0

    \[\leadsto \color{blue}{u0 \cdot \left(u0 \cdot \left(\frac{1}{3} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{2} \cdot {\alpha}^{2}\right) + {\alpha}^{2}\right)} \]
  8. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \color{blue}{\left(u0 \cdot \left(\frac{1}{3} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{2} \cdot {\alpha}^{2}\right) + {\alpha}^{2}\right)}\right) \]
    2. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(u0, \left({\alpha}^{2} + \color{blue}{u0 \cdot \left(\frac{1}{3} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{2} \cdot {\alpha}^{2}\right)}\right)\right) \]
    3. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\left({\alpha}^{2}\right), \color{blue}{\left(u0 \cdot \left(\frac{1}{3} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{2} \cdot {\alpha}^{2}\right)\right)}\right)\right) \]
    4. unpow2N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\left(\alpha \cdot \alpha\right), \left(\color{blue}{u0} \cdot \left(\frac{1}{3} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{2} \cdot {\alpha}^{2}\right)\right)\right)\right) \]
    5. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \left(\color{blue}{u0} \cdot \left(\frac{1}{3} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{2} \cdot {\alpha}^{2}\right)\right)\right)\right) \]
    6. distribute-rgt-inN/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \left(\left(\frac{1}{3} \cdot \left({\alpha}^{2} \cdot u0\right)\right) \cdot u0 + \color{blue}{\left(\frac{1}{2} \cdot {\alpha}^{2}\right) \cdot u0}\right)\right)\right) \]
    7. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \left(u0 \cdot \left(\frac{1}{3} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + \color{blue}{\left(\frac{1}{2} \cdot {\alpha}^{2}\right)} \cdot u0\right)\right)\right) \]
    8. associate-*r*N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \left(\left(u0 \cdot \frac{1}{3}\right) \cdot \left({\alpha}^{2} \cdot u0\right) + \color{blue}{\left(\frac{1}{2} \cdot {\alpha}^{2}\right)} \cdot u0\right)\right)\right) \]
    9. associate-*r*N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \left(\left(u0 \cdot \frac{1}{3}\right) \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{2} \cdot \color{blue}{\left({\alpha}^{2} \cdot u0\right)}\right)\right)\right) \]
    10. distribute-rgt-outN/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \left(\left({\alpha}^{2} \cdot u0\right) \cdot \color{blue}{\left(u0 \cdot \frac{1}{3} + \frac{1}{2}\right)}\right)\right)\right) \]
    11. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{*.f32}\left(\left({\alpha}^{2} \cdot u0\right), \color{blue}{\left(u0 \cdot \frac{1}{3} + \frac{1}{2}\right)}\right)\right)\right) \]
    12. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left({\alpha}^{2}\right), u0\right), \left(\color{blue}{u0 \cdot \frac{1}{3}} + \frac{1}{2}\right)\right)\right)\right) \]
    13. unpow2N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(\alpha \cdot \alpha\right), u0\right), \left(\color{blue}{u0} \cdot \frac{1}{3} + \frac{1}{2}\right)\right)\right)\right) \]
    14. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), u0\right), \left(\color{blue}{u0} \cdot \frac{1}{3} + \frac{1}{2}\right)\right)\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), u0\right), \left(u0 \cdot \left(\frac{1}{3} \cdot 1\right) + \frac{1}{2}\right)\right)\right)\right) \]
    16. lft-mult-inverseN/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), u0\right), \left(u0 \cdot \left(\frac{1}{3} \cdot \left(\frac{1}{u0} \cdot u0\right)\right) + \frac{1}{2}\right)\right)\right)\right) \]
    17. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), u0\right), \left(u0 \cdot \left(\left(\frac{1}{3} \cdot \frac{1}{u0}\right) \cdot u0\right) + \frac{1}{2}\right)\right)\right)\right) \]
    18. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), u0\right), \left(u0 \cdot \left(u0 \cdot \left(\frac{1}{3} \cdot \frac{1}{u0}\right)\right) + \frac{1}{2}\right)\right)\right)\right) \]
    19. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), u0\right), \left(\left(u0 \cdot u0\right) \cdot \left(\frac{1}{3} \cdot \frac{1}{u0}\right) + \frac{1}{2}\right)\right)\right)\right) \]
    20. unpow2N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), u0\right), \left({u0}^{2} \cdot \left(\frac{1}{3} \cdot \frac{1}{u0}\right) + \frac{1}{2}\right)\right)\right)\right) \]
    21. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \alpha\right), u0\right), \mathsf{+.f32}\left(\left({u0}^{2} \cdot \left(\frac{1}{3} \cdot \frac{1}{u0}\right)\right), \color{blue}{\frac{1}{2}}\right)\right)\right)\right) \]
  9. Simplified92.8%

    \[\leadsto \color{blue}{u0 \cdot \left(\alpha \cdot \alpha + \left(\left(\alpha \cdot \alpha\right) \cdot u0\right) \cdot \left(u0 \cdot 0.3333333333333333 + 0.5\right)\right)} \]
  10. Final simplification92.8%

    \[\leadsto u0 \cdot \left(\alpha \cdot \alpha + \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(0.5 + u0 \cdot 0.3333333333333333\right)\right) \]
  11. Add Preprocessing

Alternative 9: 91.0% accurate, 6.8× speedup?

\[\begin{array}{l} \\ -\left(\alpha \cdot u0\right) \cdot \left(\alpha \cdot \left(u0 \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right) + -1\right)\right) \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (-
  (*
   (* alpha u0)
   (* alpha (+ (* u0 (+ -0.5 (* u0 -0.3333333333333333))) -1.0)))))
float code(float alpha, float u0) {
	return -((alpha * u0) * (alpha * ((u0 * (-0.5f + (u0 * -0.3333333333333333f))) + -1.0f)));
}
real(4) function code(alpha, u0)
    real(4), intent (in) :: alpha
    real(4), intent (in) :: u0
    code = -((alpha * u0) * (alpha * ((u0 * ((-0.5e0) + (u0 * (-0.3333333333333333e0)))) + (-1.0e0))))
end function
function code(alpha, u0)
	return Float32(-Float32(Float32(alpha * u0) * Float32(alpha * Float32(Float32(u0 * Float32(Float32(-0.5) + Float32(u0 * Float32(-0.3333333333333333)))) + Float32(-1.0)))))
end
function tmp = code(alpha, u0)
	tmp = -((alpha * u0) * (alpha * ((u0 * (single(-0.5) + (u0 * single(-0.3333333333333333)))) + single(-1.0))));
end
\begin{array}{l}

\\
-\left(\alpha \cdot u0\right) \cdot \left(\alpha \cdot \left(u0 \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right) + -1\right)\right)
\end{array}
Derivation
  1. Initial program 52.0%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right), \color{blue}{\log \left(1 - u0\right)}\right) \]
    2. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    3. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\left(0 - \alpha \cdot \alpha\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    4. --lowering--.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \left(\alpha \cdot \alpha\right)\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    5. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \log \left(1 - \color{blue}{u0}\right)\right) \]
    6. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    7. log1p-defineN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \left(\mathsf{log1p}\left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    9. neg-lowering-neg.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(u0\right)\right)\right) \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{\left(0 - \alpha \cdot \alpha\right) \cdot \mathsf{log1p}\left(-u0\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    2. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    3. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha\right)\right), \alpha\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    4. neg-lowering-neg.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(\color{blue}{u0}\right)\right)\right) \]
  6. Applied egg-rr99.0%

    \[\leadsto \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right)} \cdot \mathsf{log1p}\left(-u0\right) \]
  7. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right)} \]
    2. associate-*r*N/A

      \[\leadsto \left(\log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right) \cdot \left(\mathsf{neg}\left(\alpha\right)\right)\right) \cdot \color{blue}{\alpha} \]
    3. distribute-rgt-neg-outN/A

      \[\leadsto \left(\mathsf{neg}\left(\log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right) \cdot \alpha\right)\right) \cdot \alpha \]
    4. *-commutativeN/A

      \[\leadsto \left(\mathsf{neg}\left(\alpha \cdot \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right)\right) \cdot \alpha \]
    5. distribute-lft-neg-outN/A

      \[\leadsto \left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right) \cdot \alpha \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right), \color{blue}{\alpha}\right) \]
    7. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha\right)\right), \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    8. neg-lowering-neg.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    9. log1p-defineN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \left(\mathsf{log1p}\left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    10. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    11. neg-lowering-neg.f3299.1%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(u0\right)\right)\right), \alpha\right) \]
  8. Applied egg-rr99.1%

    \[\leadsto \color{blue}{\left(\left(-\alpha\right) \cdot \mathsf{log1p}\left(-u0\right)\right) \cdot \alpha} \]
  9. Taylor expanded in u0 around 0

    \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right) - 1\right)\right)}\right), \alpha\right) \]
  10. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right) - 1\right)\right)\right), \alpha\right) \]
    2. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \alpha\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right) + -1\right)\right)\right), \alpha\right) \]
    4. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \left(-1 + u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right)\right)\right)\right), \alpha\right) \]
    5. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \left(u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right)\right)\right)\right)\right), \alpha\right) \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right)\right)\right)\right)\right), \alpha\right) \]
    7. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} \cdot u0 + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right)\right)\right)\right), \alpha\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} \cdot u0 + \frac{-1}{2}\right)\right)\right)\right)\right), \alpha\right) \]
    9. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{2} + \frac{-1}{3} \cdot u0\right)\right)\right)\right)\right), \alpha\right) \]
    10. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \left(\frac{-1}{3} \cdot u0\right)\right)\right)\right)\right)\right), \alpha\right) \]
    11. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \left(u0 \cdot \frac{-1}{3}\right)\right)\right)\right)\right)\right), \alpha\right) \]
    12. *-lowering-*.f3292.7%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \frac{-1}{3}\right)\right)\right)\right)\right)\right), \alpha\right) \]
  11. Simplified92.7%

    \[\leadsto \left(\left(-\alpha\right) \cdot \color{blue}{\left(u0 \cdot \left(-1 + u0 \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right)\right)\right)}\right) \cdot \alpha \]
  12. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot u0\right) \cdot \left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)\right) \cdot \alpha \]
    2. distribute-lft-neg-outN/A

      \[\leadsto \left(\left(\mathsf{neg}\left(\alpha \cdot u0\right)\right) \cdot \left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)\right) \cdot \alpha \]
    3. associate-*l*N/A

      \[\leadsto \left(\mathsf{neg}\left(\alpha \cdot u0\right)\right) \cdot \color{blue}{\left(\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right) \cdot \alpha\right)} \]
    4. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha \cdot u0\right)\right), \color{blue}{\left(\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right) \cdot \alpha\right)}\right) \]
    5. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot u0\right), \left(\color{blue}{\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)} \cdot \alpha\right)\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\left(u0 \cdot \left(\mathsf{neg}\left(\alpha\right)\right)\right), \left(\color{blue}{\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)} \cdot \alpha\right)\right) \]
    7. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \left(\mathsf{neg}\left(\alpha\right)\right)\right), \left(\color{blue}{\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)} \cdot \alpha\right)\right) \]
    8. neg-lowering-neg.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{neg.f32}\left(\alpha\right)\right), \left(\left(-1 + \color{blue}{u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)}\right) \cdot \alpha\right)\right) \]
    9. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{neg.f32}\left(\alpha\right)\right), \mathsf{*.f32}\left(\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right), \color{blue}{\alpha}\right)\right) \]
    10. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{neg.f32}\left(\alpha\right)\right), \mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \left(u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)\right), \alpha\right)\right) \]
    11. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{neg.f32}\left(\alpha\right)\right), \mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)\right), \alpha\right)\right) \]
    12. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{neg.f32}\left(\alpha\right)\right), \mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \left(u0 \cdot \frac{-1}{3}\right)\right)\right)\right), \alpha\right)\right) \]
    13. *-lowering-*.f3292.7%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{neg.f32}\left(\alpha\right)\right), \mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \frac{-1}{3}\right)\right)\right)\right), \alpha\right)\right) \]
  13. Applied egg-rr92.7%

    \[\leadsto \color{blue}{\left(u0 \cdot \left(-\alpha\right)\right) \cdot \left(\left(-1 + u0 \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right)\right) \cdot \alpha\right)} \]
  14. Final simplification92.7%

    \[\leadsto -\left(\alpha \cdot u0\right) \cdot \left(\alpha \cdot \left(u0 \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right) + -1\right)\right) \]
  15. Add Preprocessing

Alternative 10: 91.0% accurate, 6.8× speedup?

\[\begin{array}{l} \\ \left(\alpha \cdot \left(\alpha \cdot u0\right)\right) \cdot \left(\left(-u0\right) \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right) - -1\right) \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (*
  (* alpha (* alpha u0))
  (- (* (- u0) (+ -0.5 (* u0 -0.3333333333333333))) -1.0)))
float code(float alpha, float u0) {
	return (alpha * (alpha * u0)) * ((-u0 * (-0.5f + (u0 * -0.3333333333333333f))) - -1.0f);
}
real(4) function code(alpha, u0)
    real(4), intent (in) :: alpha
    real(4), intent (in) :: u0
    code = (alpha * (alpha * u0)) * ((-u0 * ((-0.5e0) + (u0 * (-0.3333333333333333e0)))) - (-1.0e0))
end function
function code(alpha, u0)
	return Float32(Float32(alpha * Float32(alpha * u0)) * Float32(Float32(Float32(-u0) * Float32(Float32(-0.5) + Float32(u0 * Float32(-0.3333333333333333)))) - Float32(-1.0)))
end
function tmp = code(alpha, u0)
	tmp = (alpha * (alpha * u0)) * ((-u0 * (single(-0.5) + (u0 * single(-0.3333333333333333)))) - single(-1.0));
end
\begin{array}{l}

\\
\left(\alpha \cdot \left(\alpha \cdot u0\right)\right) \cdot \left(\left(-u0\right) \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right) - -1\right)
\end{array}
Derivation
  1. Initial program 52.0%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right), \color{blue}{\log \left(1 - u0\right)}\right) \]
    2. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    3. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\left(0 - \alpha \cdot \alpha\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    4. --lowering--.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \left(\alpha \cdot \alpha\right)\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    5. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \log \left(1 - \color{blue}{u0}\right)\right) \]
    6. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    7. log1p-defineN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \left(\mathsf{log1p}\left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    9. neg-lowering-neg.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(u0\right)\right)\right) \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{\left(0 - \alpha \cdot \alpha\right) \cdot \mathsf{log1p}\left(-u0\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    2. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    3. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha\right)\right), \alpha\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    4. neg-lowering-neg.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(\color{blue}{u0}\right)\right)\right) \]
  6. Applied egg-rr99.0%

    \[\leadsto \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right)} \cdot \mathsf{log1p}\left(-u0\right) \]
  7. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right)} \]
    2. associate-*r*N/A

      \[\leadsto \left(\log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right) \cdot \left(\mathsf{neg}\left(\alpha\right)\right)\right) \cdot \color{blue}{\alpha} \]
    3. distribute-rgt-neg-outN/A

      \[\leadsto \left(\mathsf{neg}\left(\log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right) \cdot \alpha\right)\right) \cdot \alpha \]
    4. *-commutativeN/A

      \[\leadsto \left(\mathsf{neg}\left(\alpha \cdot \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right)\right) \cdot \alpha \]
    5. distribute-lft-neg-outN/A

      \[\leadsto \left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right) \cdot \alpha \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right), \color{blue}{\alpha}\right) \]
    7. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha\right)\right), \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    8. neg-lowering-neg.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    9. log1p-defineN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \left(\mathsf{log1p}\left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    10. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    11. neg-lowering-neg.f3299.1%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(u0\right)\right)\right), \alpha\right) \]
  8. Applied egg-rr99.1%

    \[\leadsto \color{blue}{\left(\left(-\alpha\right) \cdot \mathsf{log1p}\left(-u0\right)\right) \cdot \alpha} \]
  9. Taylor expanded in u0 around 0

    \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right) - 1\right)\right)}\right), \alpha\right) \]
  10. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right) - 1\right)\right)\right), \alpha\right) \]
    2. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \alpha\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right) + -1\right)\right)\right), \alpha\right) \]
    4. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \left(-1 + u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right)\right)\right)\right), \alpha\right) \]
    5. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \left(u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right)\right)\right)\right)\right), \alpha\right) \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right)\right)\right)\right)\right), \alpha\right) \]
    7. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} \cdot u0 + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right)\right)\right)\right), \alpha\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} \cdot u0 + \frac{-1}{2}\right)\right)\right)\right)\right), \alpha\right) \]
    9. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{2} + \frac{-1}{3} \cdot u0\right)\right)\right)\right)\right), \alpha\right) \]
    10. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \left(\frac{-1}{3} \cdot u0\right)\right)\right)\right)\right)\right), \alpha\right) \]
    11. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \left(u0 \cdot \frac{-1}{3}\right)\right)\right)\right)\right)\right), \alpha\right) \]
    12. *-lowering-*.f3292.7%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \frac{-1}{3}\right)\right)\right)\right)\right)\right), \alpha\right) \]
  11. Simplified92.7%

    \[\leadsto \left(\left(-\alpha\right) \cdot \color{blue}{\left(u0 \cdot \left(-1 + u0 \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right)\right)\right)}\right) \cdot \alpha \]
  12. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \alpha \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \left(u0 \cdot \left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)\right)\right)} \]
    2. associate-*r*N/A

      \[\leadsto \alpha \cdot \left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot u0\right) \cdot \color{blue}{\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)}\right) \]
    3. distribute-lft-neg-outN/A

      \[\leadsto \alpha \cdot \left(\left(\mathsf{neg}\left(\alpha \cdot u0\right)\right) \cdot \left(\color{blue}{-1} + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)\right) \]
    4. associate-*r*N/A

      \[\leadsto \left(\alpha \cdot \left(\mathsf{neg}\left(\alpha \cdot u0\right)\right)\right) \cdot \color{blue}{\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)} \]
    5. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\alpha \cdot \left(\mathsf{neg}\left(\alpha \cdot u0\right)\right)\right), \color{blue}{\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)}\right) \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \left(\mathsf{neg}\left(\alpha \cdot u0\right)\right)\right), \left(\color{blue}{-1} + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)\right) \]
    7. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot u0\right)\right), \left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)\right) \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \left(u0 \cdot \left(\mathsf{neg}\left(\alpha\right)\right)\right)\right), \left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)\right) \]
    9. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \left(\mathsf{neg}\left(\alpha\right)\right)\right)\right), \left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)\right) \]
    10. neg-lowering-neg.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \mathsf{neg.f32}\left(\alpha\right)\right)\right), \left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)\right) \]
    11. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \mathsf{neg.f32}\left(\alpha\right)\right)\right), \mathsf{+.f32}\left(-1, \color{blue}{\left(u0 \cdot \left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)\right)}\right)\right) \]
    12. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \mathsf{neg.f32}\left(\alpha\right)\right)\right), \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \color{blue}{\left(\frac{-1}{2} + u0 \cdot \frac{-1}{3}\right)}\right)\right)\right) \]
    13. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \mathsf{neg.f32}\left(\alpha\right)\right)\right), \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \color{blue}{\left(u0 \cdot \frac{-1}{3}\right)}\right)\right)\right)\right) \]
    14. *-lowering-*.f3292.6%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \mathsf{neg.f32}\left(\alpha\right)\right)\right), \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \color{blue}{\frac{-1}{3}}\right)\right)\right)\right)\right) \]
  13. Applied egg-rr92.6%

    \[\leadsto \color{blue}{\left(\alpha \cdot \left(u0 \cdot \left(-\alpha\right)\right)\right) \cdot \left(-1 + u0 \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right)\right)} \]
  14. Final simplification92.6%

    \[\leadsto \left(\alpha \cdot \left(\alpha \cdot u0\right)\right) \cdot \left(\left(-u0\right) \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right) - -1\right) \]
  15. Add Preprocessing

Alternative 11: 91.1% accurate, 6.8× speedup?

\[\begin{array}{l} \\ -\left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(u0 \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right) + -1\right) \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (-
  (*
   (* u0 (* alpha alpha))
   (+ (* u0 (+ -0.5 (* u0 -0.3333333333333333))) -1.0))))
float code(float alpha, float u0) {
	return -((u0 * (alpha * alpha)) * ((u0 * (-0.5f + (u0 * -0.3333333333333333f))) + -1.0f));
}
real(4) function code(alpha, u0)
    real(4), intent (in) :: alpha
    real(4), intent (in) :: u0
    code = -((u0 * (alpha * alpha)) * ((u0 * ((-0.5e0) + (u0 * (-0.3333333333333333e0)))) + (-1.0e0)))
end function
function code(alpha, u0)
	return Float32(-Float32(Float32(u0 * Float32(alpha * alpha)) * Float32(Float32(u0 * Float32(Float32(-0.5) + Float32(u0 * Float32(-0.3333333333333333)))) + Float32(-1.0))))
end
function tmp = code(alpha, u0)
	tmp = -((u0 * (alpha * alpha)) * ((u0 * (single(-0.5) + (u0 * single(-0.3333333333333333)))) + single(-1.0)));
end
\begin{array}{l}

\\
-\left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(u0 \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right) + -1\right)
\end{array}
Derivation
  1. Initial program 52.0%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Add Preprocessing
  3. Taylor expanded in u0 around 0

    \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right) - 1\right)\right)}\right) \]
  4. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right) - 1\right)}\right)\right) \]
    2. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right) + -1\right)\right)\right) \]
    4. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \left(-1 + \color{blue}{u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)}\right)\right)\right) \]
    5. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)\right)}\right)\right)\right) \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \color{blue}{\left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) - \frac{1}{2}\right)}\right)\right)\right)\right) \]
    7. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right) + \frac{-1}{2}\right)\right)\right)\right)\right) \]
    9. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{2} + \color{blue}{u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
    10. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \color{blue}{\left(u0 \cdot \left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right)\right)}\right)\right)\right)\right)\right) \]
    11. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \color{blue}{\left(\frac{-1}{4} \cdot u0 - \frac{1}{3}\right)}\right)\right)\right)\right)\right)\right) \]
    12. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \left(\frac{-1}{4} \cdot u0 + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}\right)\right)\right)\right)\right)\right)\right) \]
    13. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \left(\frac{-1}{4} \cdot u0 + \frac{-1}{3}\right)\right)\right)\right)\right)\right)\right) \]
    14. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} + \color{blue}{\frac{-1}{4} \cdot u0}\right)\right)\right)\right)\right)\right)\right) \]
    15. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \color{blue}{\left(\frac{-1}{4} \cdot u0\right)}\right)\right)\right)\right)\right)\right)\right) \]
    16. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \left(u0 \cdot \color{blue}{\frac{-1}{4}}\right)\right)\right)\right)\right)\right)\right)\right) \]
    17. *-lowering-*.f3294.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \color{blue}{\frac{-1}{4}}\right)\right)\right)\right)\right)\right)\right)\right) \]
  5. Simplified94.0%

    \[\leadsto \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \color{blue}{\left(u0 \cdot \left(-1 + u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\right)\right)} \]
  6. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot u0\right) \cdot \color{blue}{\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)} \]
    2. *-commutativeN/A

      \[\leadsto \left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right) \cdot \color{blue}{\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot u0\right)} \]
    3. distribute-lft-neg-outN/A

      \[\leadsto \left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right) \cdot u0\right) \]
    4. distribute-lft-neg-outN/A

      \[\leadsto \left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\alpha \cdot \alpha\right) \cdot u0\right)\right) \]
    5. *-commutativeN/A

      \[\leadsto \left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right) \cdot \left(\mathsf{neg}\left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right) \]
    6. distribute-rgt-neg-outN/A

      \[\leadsto \mathsf{neg}\left(\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right) \]
    7. neg-lowering-neg.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\left(\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
    8. *-lowering-*.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\left(-1 + u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right), \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
    9. +-lowering-+.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \left(u0 \cdot \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)\right), \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
    10. *-lowering-*.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{2} + u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)\right), \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
    11. +-lowering-+.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \left(u0 \cdot \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)\right)\right), \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
    12. *-lowering-*.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} + u0 \cdot \frac{-1}{4}\right)\right)\right)\right)\right), \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
    13. +-lowering-+.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \left(u0 \cdot \frac{-1}{4}\right)\right)\right)\right)\right)\right), \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
    14. *-lowering-*.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right)\right), \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
    15. *-lowering-*.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{3}, \mathsf{*.f32}\left(u0, \frac{-1}{4}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(u0, \left(\alpha \cdot \alpha\right)\right)\right)\right) \]
  7. Applied egg-rr93.9%

    \[\leadsto \color{blue}{-\left(-1 + u0 \cdot \left(-0.5 + u0 \cdot \left(-0.3333333333333333 + u0 \cdot -0.25\right)\right)\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)} \]
  8. Taylor expanded in u0 around 0

    \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\color{blue}{\left(u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right) - 1\right)}, \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right)\right)\right) \]
  9. Step-by-step derivation
    1. sub-negN/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\left(u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right) + \left(\mathsf{neg}\left(1\right)\right)\right), \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right)\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\left(u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right) + -1\right), \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right)\right)\right) \]
    3. +-commutativeN/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\left(-1 + u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right)\right), \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right)\right)\right) \]
    4. +-lowering-+.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \left(u0 \cdot \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right)\right)\right), \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right)\right)\right) \]
    5. *-lowering-*.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} \cdot u0 - \frac{1}{2}\right)\right)\right), \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right)\right)\right) \]
    6. sub-negN/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} \cdot u0 + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right)\right)\right) \]
    7. metadata-evalN/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{3} \cdot u0 + \frac{-1}{2}\right)\right)\right), \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right)\right)\right) \]
    8. +-commutativeN/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \left(\frac{-1}{2} + \frac{-1}{3} \cdot u0\right)\right)\right), \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right)\right)\right) \]
    9. +-lowering-+.f32N/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \left(\frac{-1}{3} \cdot u0\right)\right)\right)\right), \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right)\right)\right) \]
    10. *-commutativeN/A

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \left(u0 \cdot \frac{-1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right)\right)\right) \]
    11. *-lowering-*.f3292.4%

      \[\leadsto \mathsf{neg.f32}\left(\mathsf{*.f32}\left(\mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(u0, \frac{-1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right)\right)\right) \]
  10. Simplified92.4%

    \[\leadsto -\color{blue}{\left(-1 + u0 \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right)\right)} \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \]
  11. Final simplification92.4%

    \[\leadsto -\left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(u0 \cdot \left(-0.5 + u0 \cdot -0.3333333333333333\right) + -1\right) \]
  12. Add Preprocessing

Alternative 12: 87.2% accurate, 9.8× speedup?

\[\begin{array}{l} \\ \alpha \cdot \left(u0 \cdot \left(\alpha + \alpha \cdot \left(u0 \cdot 0.5\right)\right)\right) \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (* alpha (* u0 (+ alpha (* alpha (* u0 0.5))))))
float code(float alpha, float u0) {
	return alpha * (u0 * (alpha + (alpha * (u0 * 0.5f))));
}
real(4) function code(alpha, u0)
    real(4), intent (in) :: alpha
    real(4), intent (in) :: u0
    code = alpha * (u0 * (alpha + (alpha * (u0 * 0.5e0))))
end function
function code(alpha, u0)
	return Float32(alpha * Float32(u0 * Float32(alpha + Float32(alpha * Float32(u0 * Float32(0.5))))))
end
function tmp = code(alpha, u0)
	tmp = alpha * (u0 * (alpha + (alpha * (u0 * single(0.5)))));
end
\begin{array}{l}

\\
\alpha \cdot \left(u0 \cdot \left(\alpha + \alpha \cdot \left(u0 \cdot 0.5\right)\right)\right)
\end{array}
Derivation
  1. Initial program 52.0%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right), \color{blue}{\log \left(1 - u0\right)}\right) \]
    2. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    3. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\left(0 - \alpha \cdot \alpha\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    4. --lowering--.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \left(\alpha \cdot \alpha\right)\right), \log \color{blue}{\left(1 - u0\right)}\right) \]
    5. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \log \left(1 - \color{blue}{u0}\right)\right) \]
    6. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    7. log1p-defineN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \left(\mathsf{log1p}\left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(u0\right)\right)\right)\right) \]
    9. neg-lowering-neg.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{\_.f32}\left(0, \mathsf{*.f32}\left(\alpha, \alpha\right)\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(u0\right)\right)\right) \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{\left(0 - \alpha \cdot \alpha\right) \cdot \mathsf{log1p}\left(-u0\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    2. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    3. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha\right)\right), \alpha\right), \mathsf{log1p.f32}\left(\color{blue}{\mathsf{neg.f32}\left(u0\right)}\right)\right) \]
    4. neg-lowering-neg.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \alpha\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(\color{blue}{u0}\right)\right)\right) \]
  6. Applied egg-rr99.0%

    \[\leadsto \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right)} \cdot \mathsf{log1p}\left(-u0\right) \]
  7. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right)} \]
    2. associate-*r*N/A

      \[\leadsto \left(\log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right) \cdot \left(\mathsf{neg}\left(\alpha\right)\right)\right) \cdot \color{blue}{\alpha} \]
    3. distribute-rgt-neg-outN/A

      \[\leadsto \left(\mathsf{neg}\left(\log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right) \cdot \alpha\right)\right) \cdot \alpha \]
    4. *-commutativeN/A

      \[\leadsto \left(\mathsf{neg}\left(\alpha \cdot \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right)\right) \cdot \alpha \]
    5. distribute-lft-neg-outN/A

      \[\leadsto \left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right) \cdot \alpha \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right), \color{blue}{\alpha}\right) \]
    7. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(\mathsf{neg}\left(\alpha\right)\right), \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    8. neg-lowering-neg.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \log \left(1 + \left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    9. log1p-defineN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \left(\mathsf{log1p}\left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    10. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(u0\right)\right)\right)\right), \alpha\right) \]
    11. neg-lowering-neg.f3299.1%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{neg.f32}\left(\alpha\right), \mathsf{log1p.f32}\left(\mathsf{neg.f32}\left(u0\right)\right)\right), \alpha\right) \]
  8. Applied egg-rr99.1%

    \[\leadsto \color{blue}{\left(\left(-\alpha\right) \cdot \mathsf{log1p}\left(-u0\right)\right) \cdot \alpha} \]
  9. Taylor expanded in u0 around 0

    \[\leadsto \mathsf{*.f32}\left(\color{blue}{\left(u0 \cdot \left(\alpha + \frac{1}{2} \cdot \left(\alpha \cdot u0\right)\right)\right)}, \alpha\right) \]
  10. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \left(\alpha + \frac{1}{2} \cdot \left(\alpha \cdot u0\right)\right)\right), \alpha\right) \]
    2. associate-*r*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \left(\alpha + \left(\frac{1}{2} \cdot \alpha\right) \cdot u0\right)\right), \alpha\right) \]
    3. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \left(\alpha + u0 \cdot \left(\frac{1}{2} \cdot \alpha\right)\right)\right), \alpha\right) \]
    4. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \left(u0 \cdot \left(\frac{1}{2} \cdot \alpha\right)\right)\right)\right), \alpha\right) \]
    5. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \left(\left(\frac{1}{2} \cdot \alpha\right) \cdot u0\right)\right)\right), \alpha\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \left(\left(\alpha \cdot \frac{1}{2}\right) \cdot u0\right)\right)\right), \alpha\right) \]
    7. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \left(\alpha \cdot \left(\frac{1}{2} \cdot u0\right)\right)\right)\right), \alpha\right) \]
    8. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \mathsf{*.f32}\left(\alpha, \left(\frac{1}{2} \cdot u0\right)\right)\right)\right), \alpha\right) \]
    9. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \mathsf{*.f32}\left(\alpha, \left(u0 \cdot \frac{1}{2}\right)\right)\right)\right), \alpha\right) \]
    10. *-lowering-*.f3288.8%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u0, \mathsf{+.f32}\left(\alpha, \mathsf{*.f32}\left(\alpha, \mathsf{*.f32}\left(u0, \frac{1}{2}\right)\right)\right)\right), \alpha\right) \]
  11. Simplified88.8%

    \[\leadsto \color{blue}{\left(u0 \cdot \left(\alpha + \alpha \cdot \left(u0 \cdot 0.5\right)\right)\right)} \cdot \alpha \]
  12. Final simplification88.8%

    \[\leadsto \alpha \cdot \left(u0 \cdot \left(\alpha + \alpha \cdot \left(u0 \cdot 0.5\right)\right)\right) \]
  13. Add Preprocessing

Alternative 13: 87.1% accurate, 9.8× speedup?

\[\begin{array}{l} \\ u0 \cdot \left(\left(\alpha \cdot \alpha\right) \cdot \left(1 + u0 \cdot 0.5\right)\right) \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (* u0 (* (* alpha alpha) (+ 1.0 (* u0 0.5)))))
float code(float alpha, float u0) {
	return u0 * ((alpha * alpha) * (1.0f + (u0 * 0.5f)));
}
real(4) function code(alpha, u0)
    real(4), intent (in) :: alpha
    real(4), intent (in) :: u0
    code = u0 * ((alpha * alpha) * (1.0e0 + (u0 * 0.5e0)))
end function
function code(alpha, u0)
	return Float32(u0 * Float32(Float32(alpha * alpha) * Float32(Float32(1.0) + Float32(u0 * Float32(0.5)))))
end
function tmp = code(alpha, u0)
	tmp = u0 * ((alpha * alpha) * (single(1.0) + (u0 * single(0.5))));
end
\begin{array}{l}

\\
u0 \cdot \left(\left(\alpha \cdot \alpha\right) \cdot \left(1 + u0 \cdot 0.5\right)\right)
\end{array}
Derivation
  1. Initial program 52.0%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Add Preprocessing
  3. Taylor expanded in u0 around 0

    \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right) + {\alpha}^{2}\right)} \]
  4. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \color{blue}{\left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right) + {\alpha}^{2}\right)}\right) \]
    2. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(u0, \left(\frac{1}{2} \cdot \left(u0 \cdot {\alpha}^{2}\right) + {\alpha}^{2}\right)\right) \]
    3. associate-*r*N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \left(\left(\frac{1}{2} \cdot u0\right) \cdot {\alpha}^{2} + {\color{blue}{\alpha}}^{2}\right)\right) \]
    4. distribute-lft1-inN/A

      \[\leadsto \mathsf{*.f32}\left(u0, \left(\left(\frac{1}{2} \cdot u0 + 1\right) \cdot \color{blue}{{\alpha}^{2}}\right)\right) \]
    5. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(u0, \left(\left(u0 \cdot \frac{1}{2} + 1\right) \cdot {\alpha}^{2}\right)\right) \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\left(u0 \cdot \frac{1}{2} + 1\right), \color{blue}{\left({\alpha}^{2}\right)}\right)\right) \]
    7. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u0 \cdot \frac{1}{2}\right), 1\right), \left({\color{blue}{\alpha}}^{2}\right)\right)\right) \]
    8. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(u0, \frac{1}{2}\right), 1\right), \left({\alpha}^{2}\right)\right)\right) \]
    9. unpow2N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(u0, \frac{1}{2}\right), 1\right), \left(\alpha \cdot \color{blue}{\alpha}\right)\right)\right) \]
    10. *-lowering-*.f3288.5%

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(u0, \frac{1}{2}\right), 1\right), \mathsf{*.f32}\left(\alpha, \color{blue}{\alpha}\right)\right)\right) \]
  5. Simplified88.5%

    \[\leadsto \color{blue}{u0 \cdot \left(\left(u0 \cdot 0.5 + 1\right) \cdot \left(\alpha \cdot \alpha\right)\right)} \]
  6. Final simplification88.5%

    \[\leadsto u0 \cdot \left(\left(\alpha \cdot \alpha\right) \cdot \left(1 + u0 \cdot 0.5\right)\right) \]
  7. Add Preprocessing

Alternative 14: 74.4% accurate, 21.6× speedup?

\[\begin{array}{l} \\ \alpha \cdot \left(\alpha \cdot u0\right) \end{array} \]
(FPCore (alpha u0) :precision binary32 (* alpha (* alpha u0)))
float code(float alpha, float u0) {
	return alpha * (alpha * u0);
}
real(4) function code(alpha, u0)
    real(4), intent (in) :: alpha
    real(4), intent (in) :: u0
    code = alpha * (alpha * u0)
end function
function code(alpha, u0)
	return Float32(alpha * Float32(alpha * u0))
end
function tmp = code(alpha, u0)
	tmp = alpha * (alpha * u0);
end
\begin{array}{l}

\\
\alpha \cdot \left(\alpha \cdot u0\right)
\end{array}
Derivation
  1. Initial program 52.0%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Add Preprocessing
  3. Taylor expanded in u0 around 0

    \[\leadsto \color{blue}{{\alpha}^{2} \cdot u0} \]
  4. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto u0 \cdot \color{blue}{{\alpha}^{2}} \]
    2. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \color{blue}{\left({\alpha}^{2}\right)}\right) \]
    3. unpow2N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \left(\alpha \cdot \color{blue}{\alpha}\right)\right) \]
    4. *-lowering-*.f3276.9%

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\alpha, \color{blue}{\alpha}\right)\right) \]
  5. Simplified76.9%

    \[\leadsto \color{blue}{u0 \cdot \left(\alpha \cdot \alpha\right)} \]
  6. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \left(u0 \cdot \alpha\right) \cdot \color{blue}{\alpha} \]
    2. *-commutativeN/A

      \[\leadsto \left(\alpha \cdot u0\right) \cdot \alpha \]
    3. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\alpha \cdot u0\right), \color{blue}{\alpha}\right) \]
    4. *-lowering-*.f3277.1%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\alpha, u0\right), \alpha\right) \]
  7. Applied egg-rr77.1%

    \[\leadsto \color{blue}{\left(\alpha \cdot u0\right) \cdot \alpha} \]
  8. Final simplification77.1%

    \[\leadsto \alpha \cdot \left(\alpha \cdot u0\right) \]
  9. Add Preprocessing

Alternative 15: 74.5% accurate, 21.6× speedup?

\[\begin{array}{l} \\ u0 \cdot \left(\alpha \cdot \alpha\right) \end{array} \]
(FPCore (alpha u0) :precision binary32 (* u0 (* alpha alpha)))
float code(float alpha, float u0) {
	return u0 * (alpha * alpha);
}
real(4) function code(alpha, u0)
    real(4), intent (in) :: alpha
    real(4), intent (in) :: u0
    code = u0 * (alpha * alpha)
end function
function code(alpha, u0)
	return Float32(u0 * Float32(alpha * alpha))
end
function tmp = code(alpha, u0)
	tmp = u0 * (alpha * alpha);
end
\begin{array}{l}

\\
u0 \cdot \left(\alpha \cdot \alpha\right)
\end{array}
Derivation
  1. Initial program 52.0%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Add Preprocessing
  3. Taylor expanded in u0 around 0

    \[\leadsto \color{blue}{{\alpha}^{2} \cdot u0} \]
  4. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto u0 \cdot \color{blue}{{\alpha}^{2}} \]
    2. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \color{blue}{\left({\alpha}^{2}\right)}\right) \]
    3. unpow2N/A

      \[\leadsto \mathsf{*.f32}\left(u0, \left(\alpha \cdot \color{blue}{\alpha}\right)\right) \]
    4. *-lowering-*.f3276.9%

      \[\leadsto \mathsf{*.f32}\left(u0, \mathsf{*.f32}\left(\alpha, \color{blue}{\alpha}\right)\right) \]
  5. Simplified76.9%

    \[\leadsto \color{blue}{u0 \cdot \left(\alpha \cdot \alpha\right)} \]
  6. Add Preprocessing

Reproduce

?
herbie shell --seed 2024288 
(FPCore (alpha u0)
  :name "Beckmann Distribution sample, tan2theta, alphax == alphay"
  :precision binary32
  :pre (and (and (<= 0.0001 alpha) (<= alpha 1.0)) (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
  (* (* (- alpha) alpha) (log (- 1.0 u0))))