Octave 3.8, oct_fill_randg

Percentage Accurate: 99.7% → 99.8%
Time: 11.3s
Alternatives: 21
Speedup: 1.1×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := a - \frac{1}{3}\\ t\_0 \cdot \left(1 + \frac{1}{\sqrt{9 \cdot t\_0}} \cdot rand\right) \end{array} \end{array} \]
(FPCore (a rand)
 :precision binary64
 (let* ((t_0 (- a (/ 1.0 3.0))))
   (* t_0 (+ 1.0 (* (/ 1.0 (sqrt (* 9.0 t_0))) rand)))))
double code(double a, double rand) {
	double t_0 = a - (1.0 / 3.0);
	return t_0 * (1.0 + ((1.0 / sqrt((9.0 * t_0))) * rand));
}
real(8) function code(a, rand)
    real(8), intent (in) :: a
    real(8), intent (in) :: rand
    real(8) :: t_0
    t_0 = a - (1.0d0 / 3.0d0)
    code = t_0 * (1.0d0 + ((1.0d0 / sqrt((9.0d0 * t_0))) * rand))
end function
public static double code(double a, double rand) {
	double t_0 = a - (1.0 / 3.0);
	return t_0 * (1.0 + ((1.0 / Math.sqrt((9.0 * t_0))) * rand));
}
def code(a, rand):
	t_0 = a - (1.0 / 3.0)
	return t_0 * (1.0 + ((1.0 / math.sqrt((9.0 * t_0))) * rand))
function code(a, rand)
	t_0 = Float64(a - Float64(1.0 / 3.0))
	return Float64(t_0 * Float64(1.0 + Float64(Float64(1.0 / sqrt(Float64(9.0 * t_0))) * rand)))
end
function tmp = code(a, rand)
	t_0 = a - (1.0 / 3.0);
	tmp = t_0 * (1.0 + ((1.0 / sqrt((9.0 * t_0))) * rand));
end
code[a_, rand_] := Block[{t$95$0 = N[(a - N[(1.0 / 3.0), $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * N[(1.0 + N[(N[(1.0 / N[Sqrt[N[(9.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * rand), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := a - \frac{1}{3}\\
t\_0 \cdot \left(1 + \frac{1}{\sqrt{9 \cdot t\_0}} \cdot rand\right)
\end{array}
\end{array}

Sampling outcomes in binary64 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 21 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: 99.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := a - \frac{1}{3}\\ t\_0 \cdot \left(1 + \frac{1}{\sqrt{9 \cdot t\_0}} \cdot rand\right) \end{array} \end{array} \]
(FPCore (a rand)
 :precision binary64
 (let* ((t_0 (- a (/ 1.0 3.0))))
   (* t_0 (+ 1.0 (* (/ 1.0 (sqrt (* 9.0 t_0))) rand)))))
double code(double a, double rand) {
	double t_0 = a - (1.0 / 3.0);
	return t_0 * (1.0 + ((1.0 / sqrt((9.0 * t_0))) * rand));
}
real(8) function code(a, rand)
    real(8), intent (in) :: a
    real(8), intent (in) :: rand
    real(8) :: t_0
    t_0 = a - (1.0d0 / 3.0d0)
    code = t_0 * (1.0d0 + ((1.0d0 / sqrt((9.0d0 * t_0))) * rand))
end function
public static double code(double a, double rand) {
	double t_0 = a - (1.0 / 3.0);
	return t_0 * (1.0 + ((1.0 / Math.sqrt((9.0 * t_0))) * rand));
}
def code(a, rand):
	t_0 = a - (1.0 / 3.0)
	return t_0 * (1.0 + ((1.0 / math.sqrt((9.0 * t_0))) * rand))
function code(a, rand)
	t_0 = Float64(a - Float64(1.0 / 3.0))
	return Float64(t_0 * Float64(1.0 + Float64(Float64(1.0 / sqrt(Float64(9.0 * t_0))) * rand)))
end
function tmp = code(a, rand)
	t_0 = a - (1.0 / 3.0);
	tmp = t_0 * (1.0 + ((1.0 / sqrt((9.0 * t_0))) * rand));
end
code[a_, rand_] := Block[{t$95$0 = N[(a - N[(1.0 / 3.0), $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * N[(1.0 + N[(N[(1.0 / N[Sqrt[N[(9.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * rand), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := a - \frac{1}{3}\\
t\_0 \cdot \left(1 + \frac{1}{\sqrt{9 \cdot t\_0}} \cdot rand\right)
\end{array}
\end{array}

Alternative 1: 99.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ -0.3333333333333333 + \left(a + 0.3333333333333333 \cdot \left(rand \cdot \sqrt{a + -0.3333333333333333}\right)\right) \end{array} \]
(FPCore (a rand)
 :precision binary64
 (+
  -0.3333333333333333
  (+ a (* 0.3333333333333333 (* rand (sqrt (+ a -0.3333333333333333)))))))
double code(double a, double rand) {
	return -0.3333333333333333 + (a + (0.3333333333333333 * (rand * sqrt((a + -0.3333333333333333)))));
}
real(8) function code(a, rand)
    real(8), intent (in) :: a
    real(8), intent (in) :: rand
    code = (-0.3333333333333333d0) + (a + (0.3333333333333333d0 * (rand * sqrt((a + (-0.3333333333333333d0))))))
end function
public static double code(double a, double rand) {
	return -0.3333333333333333 + (a + (0.3333333333333333 * (rand * Math.sqrt((a + -0.3333333333333333)))));
}
def code(a, rand):
	return -0.3333333333333333 + (a + (0.3333333333333333 * (rand * math.sqrt((a + -0.3333333333333333)))))
function code(a, rand)
	return Float64(-0.3333333333333333 + Float64(a + Float64(0.3333333333333333 * Float64(rand * sqrt(Float64(a + -0.3333333333333333))))))
end
function tmp = code(a, rand)
	tmp = -0.3333333333333333 + (a + (0.3333333333333333 * (rand * sqrt((a + -0.3333333333333333)))));
end
code[a_, rand_] := N[(-0.3333333333333333 + N[(a + N[(0.3333333333333333 * N[(rand * N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
-0.3333333333333333 + \left(a + 0.3333333333333333 \cdot \left(rand \cdot \sqrt{a + -0.3333333333333333}\right)\right)
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
  2. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
    2. sub-negN/A

      \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
    3. +-lowering-+.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
    4. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
    6. +-lowering-+.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
    7. associate-*l/N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
    8. *-lft-identityN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
    10. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
    11. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
    13. sub-negN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
    14. +-lowering-+.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
    16. metadata-eval99.8%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in rand around 0

    \[\leadsto \color{blue}{\left(a + \frac{1}{3} \cdot \left(rand \cdot \sqrt{a - \frac{1}{3}}\right)\right) - \frac{1}{3}} \]
  6. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \left(\frac{1}{3} \cdot \left(rand \cdot \sqrt{a - \frac{1}{3}}\right) + a\right) - \frac{1}{3} \]
    2. associate--l+N/A

      \[\leadsto \frac{1}{3} \cdot \left(rand \cdot \sqrt{a - \frac{1}{3}}\right) + \color{blue}{\left(a - \frac{1}{3}\right)} \]
    3. metadata-evalN/A

      \[\leadsto \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right) \cdot \left(rand \cdot \sqrt{a - \frac{1}{3}}\right) + \left(a - \frac{1}{3}\right) \]
    4. distribute-lft-neg-inN/A

      \[\leadsto \left(\mathsf{neg}\left(\frac{-1}{3} \cdot \left(rand \cdot \sqrt{a - \frac{1}{3}}\right)\right)\right) + \left(\color{blue}{a} - \frac{1}{3}\right) \]
    5. *-commutativeN/A

      \[\leadsto \left(\mathsf{neg}\left(\frac{-1}{3} \cdot \left(\sqrt{a - \frac{1}{3}} \cdot rand\right)\right)\right) + \left(a - \frac{1}{3}\right) \]
    6. associate-*l*N/A

      \[\leadsto \left(\mathsf{neg}\left(\left(\frac{-1}{3} \cdot \sqrt{a - \frac{1}{3}}\right) \cdot rand\right)\right) + \left(a - \frac{1}{3}\right) \]
    7. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\left(\mathsf{neg}\left(\left(\frac{-1}{3} \cdot \sqrt{a - \frac{1}{3}}\right) \cdot rand\right)\right), \color{blue}{\left(a - \frac{1}{3}\right)}\right) \]
  7. Simplified99.8%

    \[\leadsto \color{blue}{\sqrt{-0.3333333333333333 + a} \cdot \left(0.3333333333333333 \cdot rand\right) + \left(-0.3333333333333333 + a\right)} \]
  8. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \sqrt{\frac{-1}{3} + a} \cdot \left(\frac{1}{3} \cdot rand\right) + \left(a + \color{blue}{\frac{-1}{3}}\right) \]
    2. associate-+r+N/A

      \[\leadsto \left(\sqrt{\frac{-1}{3} + a} \cdot \left(\frac{1}{3} \cdot rand\right) + a\right) + \color{blue}{\frac{-1}{3}} \]
    3. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\left(\sqrt{\frac{-1}{3} + a} \cdot \left(\frac{1}{3} \cdot rand\right) + a\right), \color{blue}{\frac{-1}{3}}\right) \]
    4. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\sqrt{\frac{-1}{3} + a} \cdot \left(\frac{1}{3} \cdot rand\right)\right), a\right), \frac{-1}{3}\right) \]
    5. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(\frac{1}{3} \cdot rand\right) \cdot \sqrt{\frac{-1}{3} + a}\right), a\right), \frac{-1}{3}\right) \]
    6. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\left(\frac{1}{3} \cdot rand\right) \cdot \sqrt{a + \frac{-1}{3}}\right), a\right), \frac{-1}{3}\right) \]
    7. associate-*l*N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\frac{1}{3} \cdot \left(rand \cdot \sqrt{a + \frac{-1}{3}}\right)\right), a\right), \frac{-1}{3}\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{1}{3}, \left(rand \cdot \sqrt{a + \frac{-1}{3}}\right)\right), a\right), \frac{-1}{3}\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \left(\sqrt{a + \frac{-1}{3}}\right)\right)\right), a\right), \frac{-1}{3}\right) \]
    10. pow1/2N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \left({\left(a + \frac{-1}{3}\right)}^{\frac{1}{2}}\right)\right)\right), a\right), \frac{-1}{3}\right) \]
    11. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \left({\left(\frac{-1}{3} + a\right)}^{\frac{1}{2}}\right)\right)\right), a\right), \frac{-1}{3}\right) \]
    12. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \mathsf{pow.f64}\left(\left(\frac{-1}{3} + a\right), \frac{1}{2}\right)\right)\right), a\right), \frac{-1}{3}\right) \]
    13. +-lowering-+.f6499.8%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\frac{-1}{3}, a\right), \frac{1}{2}\right)\right)\right), a\right), \frac{-1}{3}\right) \]
  9. Applied egg-rr99.8%

    \[\leadsto \color{blue}{\left(0.3333333333333333 \cdot \left(rand \cdot {\left(-0.3333333333333333 + a\right)}^{0.5}\right) + a\right) + -0.3333333333333333} \]
  10. Taylor expanded in rand around 0

    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{\left(rand \cdot \sqrt{a - \frac{1}{3}}\right)}\right), a\right), \frac{-1}{3}\right) \]
  11. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \left(\sqrt{a - \frac{1}{3}}\right)\right)\right), a\right), \frac{-1}{3}\right) \]
    2. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(a - \frac{1}{3}\right)\right)\right)\right), a\right), \frac{-1}{3}\right) \]
    3. sub-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right)\right)\right), a\right), \frac{-1}{3}\right) \]
    4. metadata-evalN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(a + \frac{-1}{3}\right)\right)\right)\right), a\right), \frac{-1}{3}\right) \]
    5. +-lowering-+.f6499.8%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right)\right)\right)\right), a\right), \frac{-1}{3}\right) \]
  12. Simplified99.8%

    \[\leadsto \left(0.3333333333333333 \cdot \color{blue}{\left(rand \cdot \sqrt{a + -0.3333333333333333}\right)} + a\right) + -0.3333333333333333 \]
  13. Final simplification99.8%

    \[\leadsto -0.3333333333333333 + \left(a + 0.3333333333333333 \cdot \left(rand \cdot \sqrt{a + -0.3333333333333333}\right)\right) \]
  14. Add Preprocessing

Alternative 2: 92.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{a + -0.3333333333333333} \cdot \left(0.3333333333333333 \cdot rand\right)\\ \mathbf{if}\;rand \leq -1 \cdot 10^{+78}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;rand \leq 7.5 \cdot 10^{+98}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a rand)
 :precision binary64
 (let* ((t_0 (* (sqrt (+ a -0.3333333333333333)) (* 0.3333333333333333 rand))))
   (if (<= rand -1e+78)
     t_0
     (if (<= rand 7.5e+98) (+ a -0.3333333333333333) t_0))))
double code(double a, double rand) {
	double t_0 = sqrt((a + -0.3333333333333333)) * (0.3333333333333333 * rand);
	double tmp;
	if (rand <= -1e+78) {
		tmp = t_0;
	} else if (rand <= 7.5e+98) {
		tmp = a + -0.3333333333333333;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(a, rand)
    real(8), intent (in) :: a
    real(8), intent (in) :: rand
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt((a + (-0.3333333333333333d0))) * (0.3333333333333333d0 * rand)
    if (rand <= (-1d+78)) then
        tmp = t_0
    else if (rand <= 7.5d+98) then
        tmp = a + (-0.3333333333333333d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double a, double rand) {
	double t_0 = Math.sqrt((a + -0.3333333333333333)) * (0.3333333333333333 * rand);
	double tmp;
	if (rand <= -1e+78) {
		tmp = t_0;
	} else if (rand <= 7.5e+98) {
		tmp = a + -0.3333333333333333;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(a, rand):
	t_0 = math.sqrt((a + -0.3333333333333333)) * (0.3333333333333333 * rand)
	tmp = 0
	if rand <= -1e+78:
		tmp = t_0
	elif rand <= 7.5e+98:
		tmp = a + -0.3333333333333333
	else:
		tmp = t_0
	return tmp
function code(a, rand)
	t_0 = Float64(sqrt(Float64(a + -0.3333333333333333)) * Float64(0.3333333333333333 * rand))
	tmp = 0.0
	if (rand <= -1e+78)
		tmp = t_0;
	elseif (rand <= 7.5e+98)
		tmp = Float64(a + -0.3333333333333333);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(a, rand)
	t_0 = sqrt((a + -0.3333333333333333)) * (0.3333333333333333 * rand);
	tmp = 0.0;
	if (rand <= -1e+78)
		tmp = t_0;
	elseif (rand <= 7.5e+98)
		tmp = a + -0.3333333333333333;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[a_, rand_] := Block[{t$95$0 = N[(N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision] * N[(0.3333333333333333 * rand), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -1e+78], t$95$0, If[LessEqual[rand, 7.5e+98], N[(a + -0.3333333333333333), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{a + -0.3333333333333333} \cdot \left(0.3333333333333333 \cdot rand\right)\\
\mathbf{if}\;rand \leq -1 \cdot 10^{+78}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;rand \leq 7.5 \cdot 10^{+98}:\\
\;\;\;\;a + -0.3333333333333333\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if rand < -1.00000000000000001e78 or 7.50000000000000036e98 < rand

    1. Initial program 99.5%

      \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
      7. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      16. metadata-eval99.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in rand around inf

      \[\leadsto \color{blue}{\frac{1}{3} \cdot \left(rand \cdot \sqrt{a - \frac{1}{3}}\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{1}{3} \cdot rand\right) \cdot \color{blue}{\sqrt{a - \frac{1}{3}}} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{a - \frac{1}{3}} \cdot \color{blue}{\left(\frac{1}{3} \cdot rand\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{a - \frac{1}{3}}\right), \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(a - \frac{1}{3}\right)\right), \left(\color{blue}{\frac{1}{3}} \cdot rand\right)\right) \]
      5. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right), \left(\frac{1}{3} \cdot rand\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(a + \frac{-1}{3}\right)\right), \left(\frac{1}{3} \cdot rand\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{-1}{3} + a\right)\right), \left(\frac{1}{3} \cdot rand\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\frac{-1}{3}, a\right)\right), \left(\frac{1}{3} \cdot rand\right)\right) \]
      9. *-lowering-*.f6489.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\frac{-1}{3}, a\right)\right), \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{rand}\right)\right) \]
    7. Simplified89.3%

      \[\leadsto \color{blue}{\sqrt{-0.3333333333333333 + a} \cdot \left(0.3333333333333333 \cdot rand\right)} \]

    if -1.00000000000000001e78 < rand < 7.50000000000000036e98

    1. Initial program 100.0%

      \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
      7. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      16. metadata-eval100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in rand around 0

      \[\leadsto \color{blue}{a - \frac{1}{3}} \]
    6. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
      2. metadata-evalN/A

        \[\leadsto a + \frac{-1}{3} \]
      3. +-commutativeN/A

        \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
      4. +-lowering-+.f6494.4%

        \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
    7. Simplified94.4%

      \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;rand \leq -1 \cdot 10^{+78}:\\ \;\;\;\;\sqrt{a + -0.3333333333333333} \cdot \left(0.3333333333333333 \cdot rand\right)\\ \mathbf{elif}\;rand \leq 7.5 \cdot 10^{+98}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\sqrt{a + -0.3333333333333333} \cdot \left(0.3333333333333333 \cdot rand\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 92.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;rand \leq -1.5 \cdot 10^{+76}:\\ \;\;\;\;\sqrt{a} \cdot \frac{rand}{3}\\ \mathbf{elif}\;rand \leq 1.8 \cdot 10^{+99}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{a}}{\frac{3}{rand}}\\ \end{array} \end{array} \]
(FPCore (a rand)
 :precision binary64
 (if (<= rand -1.5e+76)
   (* (sqrt a) (/ rand 3.0))
   (if (<= rand 1.8e+99) (+ a -0.3333333333333333) (/ (sqrt a) (/ 3.0 rand)))))
double code(double a, double rand) {
	double tmp;
	if (rand <= -1.5e+76) {
		tmp = sqrt(a) * (rand / 3.0);
	} else if (rand <= 1.8e+99) {
		tmp = a + -0.3333333333333333;
	} else {
		tmp = sqrt(a) / (3.0 / rand);
	}
	return tmp;
}
real(8) function code(a, rand)
    real(8), intent (in) :: a
    real(8), intent (in) :: rand
    real(8) :: tmp
    if (rand <= (-1.5d+76)) then
        tmp = sqrt(a) * (rand / 3.0d0)
    else if (rand <= 1.8d+99) then
        tmp = a + (-0.3333333333333333d0)
    else
        tmp = sqrt(a) / (3.0d0 / rand)
    end if
    code = tmp
end function
public static double code(double a, double rand) {
	double tmp;
	if (rand <= -1.5e+76) {
		tmp = Math.sqrt(a) * (rand / 3.0);
	} else if (rand <= 1.8e+99) {
		tmp = a + -0.3333333333333333;
	} else {
		tmp = Math.sqrt(a) / (3.0 / rand);
	}
	return tmp;
}
def code(a, rand):
	tmp = 0
	if rand <= -1.5e+76:
		tmp = math.sqrt(a) * (rand / 3.0)
	elif rand <= 1.8e+99:
		tmp = a + -0.3333333333333333
	else:
		tmp = math.sqrt(a) / (3.0 / rand)
	return tmp
function code(a, rand)
	tmp = 0.0
	if (rand <= -1.5e+76)
		tmp = Float64(sqrt(a) * Float64(rand / 3.0));
	elseif (rand <= 1.8e+99)
		tmp = Float64(a + -0.3333333333333333);
	else
		tmp = Float64(sqrt(a) / Float64(3.0 / rand));
	end
	return tmp
end
function tmp_2 = code(a, rand)
	tmp = 0.0;
	if (rand <= -1.5e+76)
		tmp = sqrt(a) * (rand / 3.0);
	elseif (rand <= 1.8e+99)
		tmp = a + -0.3333333333333333;
	else
		tmp = sqrt(a) / (3.0 / rand);
	end
	tmp_2 = tmp;
end
code[a_, rand_] := If[LessEqual[rand, -1.5e+76], N[(N[Sqrt[a], $MachinePrecision] * N[(rand / 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 1.8e+99], N[(a + -0.3333333333333333), $MachinePrecision], N[(N[Sqrt[a], $MachinePrecision] / N[(3.0 / rand), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;rand \leq -1.5 \cdot 10^{+76}:\\
\;\;\;\;\sqrt{a} \cdot \frac{rand}{3}\\

\mathbf{elif}\;rand \leq 1.8 \cdot 10^{+99}:\\
\;\;\;\;a + -0.3333333333333333\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{a}}{\frac{3}{rand}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if rand < -1.4999999999999999e76

    1. Initial program 99.5%

      \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
      7. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      16. metadata-eval99.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\frac{1}{3} \cdot \sqrt{\frac{1}{a}}\right) \cdot \color{blue}{rand}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\sqrt{\frac{1}{a}} \cdot \frac{1}{3}\right) \cdot rand\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{a}} \cdot \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{a}}\right), \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{a}\right)\right), \left(\color{blue}{\frac{1}{3}} \cdot rand\right)\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \left(\frac{1}{3} \cdot rand\right)\right)\right)\right) \]
      9. *-lowering-*.f6498.2%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{rand}\right)\right)\right)\right) \]
    7. Simplified98.2%

      \[\leadsto \color{blue}{a \cdot \left(1 + \sqrt{\frac{1}{a}} \cdot \left(0.3333333333333333 \cdot rand\right)\right)} \]
    8. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\frac{1}{3} \cdot \left(\sqrt{a} \cdot rand\right)} \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{\left(\sqrt{a} \cdot rand\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \left(rand \cdot \color{blue}{\sqrt{a}}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \color{blue}{\left(\sqrt{a}\right)}\right)\right) \]
      4. sqrt-lowering-sqrt.f6485.3%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \mathsf{sqrt.f64}\left(a\right)\right)\right) \]
    10. Simplified85.3%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)} \]
    11. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(rand \cdot \sqrt{a}\right) \cdot \color{blue}{\frac{1}{3}} \]
      2. metadata-evalN/A

        \[\leadsto \left(rand \cdot \sqrt{a}\right) \cdot \frac{1}{\color{blue}{3}} \]
      3. div-invN/A

        \[\leadsto \frac{rand \cdot \sqrt{a}}{\color{blue}{3}} \]
      4. associate-*l/N/A

        \[\leadsto \frac{rand}{3} \cdot \color{blue}{\sqrt{a}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{rand}{3}\right), \color{blue}{\left(\sqrt{a}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(rand, 3\right), \left(\sqrt{\color{blue}{a}}\right)\right) \]
      7. sqrt-lowering-sqrt.f6485.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(rand, 3\right), \mathsf{sqrt.f64}\left(a\right)\right) \]
    12. Applied egg-rr85.5%

      \[\leadsto \color{blue}{\frac{rand}{3} \cdot \sqrt{a}} \]

    if -1.4999999999999999e76 < rand < 1.8000000000000001e99

    1. Initial program 100.0%

      \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
      7. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      16. metadata-eval100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in rand around 0

      \[\leadsto \color{blue}{a - \frac{1}{3}} \]
    6. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
      2. metadata-evalN/A

        \[\leadsto a + \frac{-1}{3} \]
      3. +-commutativeN/A

        \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
      4. +-lowering-+.f6494.4%

        \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
    7. Simplified94.4%

      \[\leadsto \color{blue}{-0.3333333333333333 + a} \]

    if 1.8000000000000001e99 < rand

    1. Initial program 99.4%

      \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
      7. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      16. metadata-eval99.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\frac{1}{3} \cdot \sqrt{\frac{1}{a}}\right) \cdot \color{blue}{rand}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\sqrt{\frac{1}{a}} \cdot \frac{1}{3}\right) \cdot rand\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{a}} \cdot \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{a}}\right), \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{a}\right)\right), \left(\color{blue}{\frac{1}{3}} \cdot rand\right)\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \left(\frac{1}{3} \cdot rand\right)\right)\right)\right) \]
      9. *-lowering-*.f6498.3%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{rand}\right)\right)\right)\right) \]
    7. Simplified98.3%

      \[\leadsto \color{blue}{a \cdot \left(1 + \sqrt{\frac{1}{a}} \cdot \left(0.3333333333333333 \cdot rand\right)\right)} \]
    8. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\frac{1}{3} \cdot \left(\sqrt{a} \cdot rand\right)} \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{\left(\sqrt{a} \cdot rand\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \left(rand \cdot \color{blue}{\sqrt{a}}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \color{blue}{\left(\sqrt{a}\right)}\right)\right) \]
      4. sqrt-lowering-sqrt.f6491.8%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \mathsf{sqrt.f64}\left(a\right)\right)\right) \]
    10. Simplified91.8%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)} \]
    11. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{1}{3} \cdot rand\right) \cdot \color{blue}{\sqrt{a}} \]
      2. metadata-evalN/A

        \[\leadsto \left(\frac{1}{3} \cdot rand\right) \cdot \sqrt{a} \]
      3. associate-/r/N/A

        \[\leadsto \frac{1}{\frac{3}{rand}} \cdot \sqrt{\color{blue}{a}} \]
      4. associate-*l/N/A

        \[\leadsto \frac{1 \cdot \sqrt{a}}{\color{blue}{\frac{3}{rand}}} \]
      5. *-lft-identityN/A

        \[\leadsto \frac{\sqrt{a}}{\frac{\color{blue}{3}}{rand}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{a}\right), \color{blue}{\left(\frac{3}{rand}\right)}\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(a\right), \left(\frac{\color{blue}{3}}{rand}\right)\right) \]
      8. /-lowering-/.f6492.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(a\right), \mathsf{/.f64}\left(3, \color{blue}{rand}\right)\right) \]
    12. Applied egg-rr92.0%

      \[\leadsto \color{blue}{\frac{\sqrt{a}}{\frac{3}{rand}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;rand \leq -1.5 \cdot 10^{+76}:\\ \;\;\;\;\sqrt{a} \cdot \frac{rand}{3}\\ \mathbf{elif}\;rand \leq 1.8 \cdot 10^{+99}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{a}}{\frac{3}{rand}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 92.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{a} \cdot \frac{rand}{3}\\ \mathbf{if}\;rand \leq -5.6 \cdot 10^{+78}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;rand \leq 9.5 \cdot 10^{+98}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a rand)
 :precision binary64
 (let* ((t_0 (* (sqrt a) (/ rand 3.0))))
   (if (<= rand -5.6e+78)
     t_0
     (if (<= rand 9.5e+98) (+ a -0.3333333333333333) t_0))))
double code(double a, double rand) {
	double t_0 = sqrt(a) * (rand / 3.0);
	double tmp;
	if (rand <= -5.6e+78) {
		tmp = t_0;
	} else if (rand <= 9.5e+98) {
		tmp = a + -0.3333333333333333;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(a, rand)
    real(8), intent (in) :: a
    real(8), intent (in) :: rand
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt(a) * (rand / 3.0d0)
    if (rand <= (-5.6d+78)) then
        tmp = t_0
    else if (rand <= 9.5d+98) then
        tmp = a + (-0.3333333333333333d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double a, double rand) {
	double t_0 = Math.sqrt(a) * (rand / 3.0);
	double tmp;
	if (rand <= -5.6e+78) {
		tmp = t_0;
	} else if (rand <= 9.5e+98) {
		tmp = a + -0.3333333333333333;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(a, rand):
	t_0 = math.sqrt(a) * (rand / 3.0)
	tmp = 0
	if rand <= -5.6e+78:
		tmp = t_0
	elif rand <= 9.5e+98:
		tmp = a + -0.3333333333333333
	else:
		tmp = t_0
	return tmp
function code(a, rand)
	t_0 = Float64(sqrt(a) * Float64(rand / 3.0))
	tmp = 0.0
	if (rand <= -5.6e+78)
		tmp = t_0;
	elseif (rand <= 9.5e+98)
		tmp = Float64(a + -0.3333333333333333);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(a, rand)
	t_0 = sqrt(a) * (rand / 3.0);
	tmp = 0.0;
	if (rand <= -5.6e+78)
		tmp = t_0;
	elseif (rand <= 9.5e+98)
		tmp = a + -0.3333333333333333;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[a_, rand_] := Block[{t$95$0 = N[(N[Sqrt[a], $MachinePrecision] * N[(rand / 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -5.6e+78], t$95$0, If[LessEqual[rand, 9.5e+98], N[(a + -0.3333333333333333), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{a} \cdot \frac{rand}{3}\\
\mathbf{if}\;rand \leq -5.6 \cdot 10^{+78}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;rand \leq 9.5 \cdot 10^{+98}:\\
\;\;\;\;a + -0.3333333333333333\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if rand < -5.6000000000000002e78 or 9.5000000000000001e98 < rand

    1. Initial program 99.5%

      \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
      7. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      16. metadata-eval99.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\frac{1}{3} \cdot \sqrt{\frac{1}{a}}\right) \cdot \color{blue}{rand}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\sqrt{\frac{1}{a}} \cdot \frac{1}{3}\right) \cdot rand\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{a}} \cdot \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{a}}\right), \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{a}\right)\right), \left(\color{blue}{\frac{1}{3}} \cdot rand\right)\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \left(\frac{1}{3} \cdot rand\right)\right)\right)\right) \]
      9. *-lowering-*.f6498.2%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{rand}\right)\right)\right)\right) \]
    7. Simplified98.2%

      \[\leadsto \color{blue}{a \cdot \left(1 + \sqrt{\frac{1}{a}} \cdot \left(0.3333333333333333 \cdot rand\right)\right)} \]
    8. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\frac{1}{3} \cdot \left(\sqrt{a} \cdot rand\right)} \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{\left(\sqrt{a} \cdot rand\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \left(rand \cdot \color{blue}{\sqrt{a}}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \color{blue}{\left(\sqrt{a}\right)}\right)\right) \]
      4. sqrt-lowering-sqrt.f6488.2%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \mathsf{sqrt.f64}\left(a\right)\right)\right) \]
    10. Simplified88.2%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)} \]
    11. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(rand \cdot \sqrt{a}\right) \cdot \color{blue}{\frac{1}{3}} \]
      2. metadata-evalN/A

        \[\leadsto \left(rand \cdot \sqrt{a}\right) \cdot \frac{1}{\color{blue}{3}} \]
      3. div-invN/A

        \[\leadsto \frac{rand \cdot \sqrt{a}}{\color{blue}{3}} \]
      4. associate-*l/N/A

        \[\leadsto \frac{rand}{3} \cdot \color{blue}{\sqrt{a}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{rand}{3}\right), \color{blue}{\left(\sqrt{a}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(rand, 3\right), \left(\sqrt{\color{blue}{a}}\right)\right) \]
      7. sqrt-lowering-sqrt.f6488.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(rand, 3\right), \mathsf{sqrt.f64}\left(a\right)\right) \]
    12. Applied egg-rr88.3%

      \[\leadsto \color{blue}{\frac{rand}{3} \cdot \sqrt{a}} \]

    if -5.6000000000000002e78 < rand < 9.5000000000000001e98

    1. Initial program 100.0%

      \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
      7. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      16. metadata-eval100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in rand around 0

      \[\leadsto \color{blue}{a - \frac{1}{3}} \]
    6. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
      2. metadata-evalN/A

        \[\leadsto a + \frac{-1}{3} \]
      3. +-commutativeN/A

        \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
      4. +-lowering-+.f6494.4%

        \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
    7. Simplified94.4%

      \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;rand \leq -5.6 \cdot 10^{+78}:\\ \;\;\;\;\sqrt{a} \cdot \frac{rand}{3}\\ \mathbf{elif}\;rand \leq 9.5 \cdot 10^{+98}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\sqrt{a} \cdot \frac{rand}{3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 91.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;rand \leq -1.25 \cdot 10^{+80}:\\ \;\;\;\;0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)\\ \mathbf{elif}\;rand \leq 1.15 \cdot 10^{+99}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;rand \cdot \frac{\sqrt{a}}{3}\\ \end{array} \end{array} \]
(FPCore (a rand)
 :precision binary64
 (if (<= rand -1.25e+80)
   (* 0.3333333333333333 (* rand (sqrt a)))
   (if (<= rand 1.15e+99)
     (+ a -0.3333333333333333)
     (* rand (/ (sqrt a) 3.0)))))
double code(double a, double rand) {
	double tmp;
	if (rand <= -1.25e+80) {
		tmp = 0.3333333333333333 * (rand * sqrt(a));
	} else if (rand <= 1.15e+99) {
		tmp = a + -0.3333333333333333;
	} else {
		tmp = rand * (sqrt(a) / 3.0);
	}
	return tmp;
}
real(8) function code(a, rand)
    real(8), intent (in) :: a
    real(8), intent (in) :: rand
    real(8) :: tmp
    if (rand <= (-1.25d+80)) then
        tmp = 0.3333333333333333d0 * (rand * sqrt(a))
    else if (rand <= 1.15d+99) then
        tmp = a + (-0.3333333333333333d0)
    else
        tmp = rand * (sqrt(a) / 3.0d0)
    end if
    code = tmp
end function
public static double code(double a, double rand) {
	double tmp;
	if (rand <= -1.25e+80) {
		tmp = 0.3333333333333333 * (rand * Math.sqrt(a));
	} else if (rand <= 1.15e+99) {
		tmp = a + -0.3333333333333333;
	} else {
		tmp = rand * (Math.sqrt(a) / 3.0);
	}
	return tmp;
}
def code(a, rand):
	tmp = 0
	if rand <= -1.25e+80:
		tmp = 0.3333333333333333 * (rand * math.sqrt(a))
	elif rand <= 1.15e+99:
		tmp = a + -0.3333333333333333
	else:
		tmp = rand * (math.sqrt(a) / 3.0)
	return tmp
function code(a, rand)
	tmp = 0.0
	if (rand <= -1.25e+80)
		tmp = Float64(0.3333333333333333 * Float64(rand * sqrt(a)));
	elseif (rand <= 1.15e+99)
		tmp = Float64(a + -0.3333333333333333);
	else
		tmp = Float64(rand * Float64(sqrt(a) / 3.0));
	end
	return tmp
end
function tmp_2 = code(a, rand)
	tmp = 0.0;
	if (rand <= -1.25e+80)
		tmp = 0.3333333333333333 * (rand * sqrt(a));
	elseif (rand <= 1.15e+99)
		tmp = a + -0.3333333333333333;
	else
		tmp = rand * (sqrt(a) / 3.0);
	end
	tmp_2 = tmp;
end
code[a_, rand_] := If[LessEqual[rand, -1.25e+80], N[(0.3333333333333333 * N[(rand * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 1.15e+99], N[(a + -0.3333333333333333), $MachinePrecision], N[(rand * N[(N[Sqrt[a], $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;rand \leq -1.25 \cdot 10^{+80}:\\
\;\;\;\;0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)\\

\mathbf{elif}\;rand \leq 1.15 \cdot 10^{+99}:\\
\;\;\;\;a + -0.3333333333333333\\

\mathbf{else}:\\
\;\;\;\;rand \cdot \frac{\sqrt{a}}{3}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if rand < -1.2499999999999999e80

    1. Initial program 99.5%

      \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
      7. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      16. metadata-eval99.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\frac{1}{3} \cdot \sqrt{\frac{1}{a}}\right) \cdot \color{blue}{rand}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\sqrt{\frac{1}{a}} \cdot \frac{1}{3}\right) \cdot rand\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{a}} \cdot \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{a}}\right), \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{a}\right)\right), \left(\color{blue}{\frac{1}{3}} \cdot rand\right)\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \left(\frac{1}{3} \cdot rand\right)\right)\right)\right) \]
      9. *-lowering-*.f6498.2%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{rand}\right)\right)\right)\right) \]
    7. Simplified98.2%

      \[\leadsto \color{blue}{a \cdot \left(1 + \sqrt{\frac{1}{a}} \cdot \left(0.3333333333333333 \cdot rand\right)\right)} \]
    8. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\frac{1}{3} \cdot \left(\sqrt{a} \cdot rand\right)} \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{\left(\sqrt{a} \cdot rand\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \left(rand \cdot \color{blue}{\sqrt{a}}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \color{blue}{\left(\sqrt{a}\right)}\right)\right) \]
      4. sqrt-lowering-sqrt.f6485.3%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \mathsf{sqrt.f64}\left(a\right)\right)\right) \]
    10. Simplified85.3%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)} \]

    if -1.2499999999999999e80 < rand < 1.1500000000000001e99

    1. Initial program 100.0%

      \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
      7. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      16. metadata-eval100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in rand around 0

      \[\leadsto \color{blue}{a - \frac{1}{3}} \]
    6. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
      2. metadata-evalN/A

        \[\leadsto a + \frac{-1}{3} \]
      3. +-commutativeN/A

        \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
      4. +-lowering-+.f6494.4%

        \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
    7. Simplified94.4%

      \[\leadsto \color{blue}{-0.3333333333333333 + a} \]

    if 1.1500000000000001e99 < rand

    1. Initial program 99.4%

      \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
      7. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      16. metadata-eval99.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\frac{1}{3} \cdot \sqrt{\frac{1}{a}}\right) \cdot \color{blue}{rand}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\sqrt{\frac{1}{a}} \cdot \frac{1}{3}\right) \cdot rand\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{a}} \cdot \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{a}}\right), \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{a}\right)\right), \left(\color{blue}{\frac{1}{3}} \cdot rand\right)\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \left(\frac{1}{3} \cdot rand\right)\right)\right)\right) \]
      9. *-lowering-*.f6498.3%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{rand}\right)\right)\right)\right) \]
    7. Simplified98.3%

      \[\leadsto \color{blue}{a \cdot \left(1 + \sqrt{\frac{1}{a}} \cdot \left(0.3333333333333333 \cdot rand\right)\right)} \]
    8. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\frac{1}{3} \cdot \left(\sqrt{a} \cdot rand\right)} \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{\left(\sqrt{a} \cdot rand\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \left(rand \cdot \color{blue}{\sqrt{a}}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \color{blue}{\left(\sqrt{a}\right)}\right)\right) \]
      4. sqrt-lowering-sqrt.f6491.8%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \mathsf{sqrt.f64}\left(a\right)\right)\right) \]
    10. Simplified91.8%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)} \]
    11. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(rand \cdot \sqrt{a}\right) \cdot \color{blue}{\frac{1}{3}} \]
      2. metadata-evalN/A

        \[\leadsto \left(rand \cdot \sqrt{a}\right) \cdot \frac{1}{\color{blue}{3}} \]
      3. div-invN/A

        \[\leadsto \frac{rand \cdot \sqrt{a}}{\color{blue}{3}} \]
      4. associate-/l*N/A

        \[\leadsto rand \cdot \color{blue}{\frac{\sqrt{a}}{3}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(rand, \color{blue}{\left(\frac{\sqrt{a}}{3}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(rand, \mathsf{/.f64}\left(\left(\sqrt{a}\right), \color{blue}{3}\right)\right) \]
      7. sqrt-lowering-sqrt.f6491.8%

        \[\leadsto \mathsf{*.f64}\left(rand, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(a\right), 3\right)\right) \]
    12. Applied egg-rr91.8%

      \[\leadsto \color{blue}{rand \cdot \frac{\sqrt{a}}{3}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;rand \leq -1.25 \cdot 10^{+80}:\\ \;\;\;\;0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)\\ \mathbf{elif}\;rand \leq 1.15 \cdot 10^{+99}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;rand \cdot \frac{\sqrt{a}}{3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 91.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)\\ \mathbf{if}\;rand \leq -2.5 \cdot 10^{+80}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;rand \leq 4.5 \cdot 10^{+99}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a rand)
 :precision binary64
 (let* ((t_0 (* 0.3333333333333333 (* rand (sqrt a)))))
   (if (<= rand -2.5e+80)
     t_0
     (if (<= rand 4.5e+99) (+ a -0.3333333333333333) t_0))))
double code(double a, double rand) {
	double t_0 = 0.3333333333333333 * (rand * sqrt(a));
	double tmp;
	if (rand <= -2.5e+80) {
		tmp = t_0;
	} else if (rand <= 4.5e+99) {
		tmp = a + -0.3333333333333333;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(a, rand)
    real(8), intent (in) :: a
    real(8), intent (in) :: rand
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 0.3333333333333333d0 * (rand * sqrt(a))
    if (rand <= (-2.5d+80)) then
        tmp = t_0
    else if (rand <= 4.5d+99) then
        tmp = a + (-0.3333333333333333d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double a, double rand) {
	double t_0 = 0.3333333333333333 * (rand * Math.sqrt(a));
	double tmp;
	if (rand <= -2.5e+80) {
		tmp = t_0;
	} else if (rand <= 4.5e+99) {
		tmp = a + -0.3333333333333333;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(a, rand):
	t_0 = 0.3333333333333333 * (rand * math.sqrt(a))
	tmp = 0
	if rand <= -2.5e+80:
		tmp = t_0
	elif rand <= 4.5e+99:
		tmp = a + -0.3333333333333333
	else:
		tmp = t_0
	return tmp
function code(a, rand)
	t_0 = Float64(0.3333333333333333 * Float64(rand * sqrt(a)))
	tmp = 0.0
	if (rand <= -2.5e+80)
		tmp = t_0;
	elseif (rand <= 4.5e+99)
		tmp = Float64(a + -0.3333333333333333);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(a, rand)
	t_0 = 0.3333333333333333 * (rand * sqrt(a));
	tmp = 0.0;
	if (rand <= -2.5e+80)
		tmp = t_0;
	elseif (rand <= 4.5e+99)
		tmp = a + -0.3333333333333333;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[a_, rand_] := Block[{t$95$0 = N[(0.3333333333333333 * N[(rand * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -2.5e+80], t$95$0, If[LessEqual[rand, 4.5e+99], N[(a + -0.3333333333333333), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)\\
\mathbf{if}\;rand \leq -2.5 \cdot 10^{+80}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;rand \leq 4.5 \cdot 10^{+99}:\\
\;\;\;\;a + -0.3333333333333333\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if rand < -2.4999999999999998e80 or 4.5e99 < rand

    1. Initial program 99.5%

      \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
      7. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      16. metadata-eval99.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\frac{1}{3} \cdot \sqrt{\frac{1}{a}}\right) \cdot \color{blue}{rand}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\sqrt{\frac{1}{a}} \cdot \frac{1}{3}\right) \cdot rand\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{a}} \cdot \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{a}}\right), \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{a}\right)\right), \left(\color{blue}{\frac{1}{3}} \cdot rand\right)\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \left(\frac{1}{3} \cdot rand\right)\right)\right)\right) \]
      9. *-lowering-*.f6498.2%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{rand}\right)\right)\right)\right) \]
    7. Simplified98.2%

      \[\leadsto \color{blue}{a \cdot \left(1 + \sqrt{\frac{1}{a}} \cdot \left(0.3333333333333333 \cdot rand\right)\right)} \]
    8. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\frac{1}{3} \cdot \left(\sqrt{a} \cdot rand\right)} \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{\left(\sqrt{a} \cdot rand\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \left(rand \cdot \color{blue}{\sqrt{a}}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \color{blue}{\left(\sqrt{a}\right)}\right)\right) \]
      4. sqrt-lowering-sqrt.f6488.2%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \mathsf{sqrt.f64}\left(a\right)\right)\right) \]
    10. Simplified88.2%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)} \]

    if -2.4999999999999998e80 < rand < 4.5e99

    1. Initial program 100.0%

      \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
      7. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      16. metadata-eval100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in rand around 0

      \[\leadsto \color{blue}{a - \frac{1}{3}} \]
    6. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
      2. metadata-evalN/A

        \[\leadsto a + \frac{-1}{3} \]
      3. +-commutativeN/A

        \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
      4. +-lowering-+.f6494.4%

        \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
    7. Simplified94.4%

      \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;rand \leq -2.5 \cdot 10^{+80}:\\ \;\;\;\;0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)\\ \mathbf{elif}\;rand \leq 4.5 \cdot 10^{+99}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 99.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \left(a + -0.3333333333333333\right) + \sqrt{a + -0.3333333333333333} \cdot \left(0.3333333333333333 \cdot rand\right) \end{array} \]
(FPCore (a rand)
 :precision binary64
 (+
  (+ a -0.3333333333333333)
  (* (sqrt (+ a -0.3333333333333333)) (* 0.3333333333333333 rand))))
double code(double a, double rand) {
	return (a + -0.3333333333333333) + (sqrt((a + -0.3333333333333333)) * (0.3333333333333333 * rand));
}
real(8) function code(a, rand)
    real(8), intent (in) :: a
    real(8), intent (in) :: rand
    code = (a + (-0.3333333333333333d0)) + (sqrt((a + (-0.3333333333333333d0))) * (0.3333333333333333d0 * rand))
end function
public static double code(double a, double rand) {
	return (a + -0.3333333333333333) + (Math.sqrt((a + -0.3333333333333333)) * (0.3333333333333333 * rand));
}
def code(a, rand):
	return (a + -0.3333333333333333) + (math.sqrt((a + -0.3333333333333333)) * (0.3333333333333333 * rand))
function code(a, rand)
	return Float64(Float64(a + -0.3333333333333333) + Float64(sqrt(Float64(a + -0.3333333333333333)) * Float64(0.3333333333333333 * rand)))
end
function tmp = code(a, rand)
	tmp = (a + -0.3333333333333333) + (sqrt((a + -0.3333333333333333)) * (0.3333333333333333 * rand));
end
code[a_, rand_] := N[(N[(a + -0.3333333333333333), $MachinePrecision] + N[(N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision] * N[(0.3333333333333333 * rand), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(a + -0.3333333333333333\right) + \sqrt{a + -0.3333333333333333} \cdot \left(0.3333333333333333 \cdot rand\right)
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
  2. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
    2. sub-negN/A

      \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
    3. +-lowering-+.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
    4. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
    6. +-lowering-+.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
    7. associate-*l/N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
    8. *-lft-identityN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
    10. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
    11. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
    13. sub-negN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
    14. +-lowering-+.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
    16. metadata-eval99.8%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in rand around 0

    \[\leadsto \color{blue}{\left(a + \frac{1}{3} \cdot \left(rand \cdot \sqrt{a - \frac{1}{3}}\right)\right) - \frac{1}{3}} \]
  6. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \left(\frac{1}{3} \cdot \left(rand \cdot \sqrt{a - \frac{1}{3}}\right) + a\right) - \frac{1}{3} \]
    2. associate--l+N/A

      \[\leadsto \frac{1}{3} \cdot \left(rand \cdot \sqrt{a - \frac{1}{3}}\right) + \color{blue}{\left(a - \frac{1}{3}\right)} \]
    3. metadata-evalN/A

      \[\leadsto \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right) \cdot \left(rand \cdot \sqrt{a - \frac{1}{3}}\right) + \left(a - \frac{1}{3}\right) \]
    4. distribute-lft-neg-inN/A

      \[\leadsto \left(\mathsf{neg}\left(\frac{-1}{3} \cdot \left(rand \cdot \sqrt{a - \frac{1}{3}}\right)\right)\right) + \left(\color{blue}{a} - \frac{1}{3}\right) \]
    5. *-commutativeN/A

      \[\leadsto \left(\mathsf{neg}\left(\frac{-1}{3} \cdot \left(\sqrt{a - \frac{1}{3}} \cdot rand\right)\right)\right) + \left(a - \frac{1}{3}\right) \]
    6. associate-*l*N/A

      \[\leadsto \left(\mathsf{neg}\left(\left(\frac{-1}{3} \cdot \sqrt{a - \frac{1}{3}}\right) \cdot rand\right)\right) + \left(a - \frac{1}{3}\right) \]
    7. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\left(\mathsf{neg}\left(\left(\frac{-1}{3} \cdot \sqrt{a - \frac{1}{3}}\right) \cdot rand\right)\right), \color{blue}{\left(a - \frac{1}{3}\right)}\right) \]
  7. Simplified99.8%

    \[\leadsto \color{blue}{\sqrt{-0.3333333333333333 + a} \cdot \left(0.3333333333333333 \cdot rand\right) + \left(-0.3333333333333333 + a\right)} \]
  8. Final simplification99.8%

    \[\leadsto \left(a + -0.3333333333333333\right) + \sqrt{a + -0.3333333333333333} \cdot \left(0.3333333333333333 \cdot rand\right) \]
  9. Add Preprocessing

Alternative 8: 98.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{a \cdot 9}}\right) \end{array} \]
(FPCore (a rand)
 :precision binary64
 (* (+ a -0.3333333333333333) (+ 1.0 (/ rand (sqrt (* a 9.0))))))
double code(double a, double rand) {
	return (a + -0.3333333333333333) * (1.0 + (rand / sqrt((a * 9.0))));
}
real(8) function code(a, rand)
    real(8), intent (in) :: a
    real(8), intent (in) :: rand
    code = (a + (-0.3333333333333333d0)) * (1.0d0 + (rand / sqrt((a * 9.0d0))))
end function
public static double code(double a, double rand) {
	return (a + -0.3333333333333333) * (1.0 + (rand / Math.sqrt((a * 9.0))));
}
def code(a, rand):
	return (a + -0.3333333333333333) * (1.0 + (rand / math.sqrt((a * 9.0))))
function code(a, rand)
	return Float64(Float64(a + -0.3333333333333333) * Float64(1.0 + Float64(rand / sqrt(Float64(a * 9.0)))))
end
function tmp = code(a, rand)
	tmp = (a + -0.3333333333333333) * (1.0 + (rand / sqrt((a * 9.0))));
end
code[a_, rand_] := N[(N[(a + -0.3333333333333333), $MachinePrecision] * N[(1.0 + N[(rand / N[Sqrt[N[(a * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{a \cdot 9}}\right)
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
  2. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
    2. sub-negN/A

      \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
    3. +-lowering-+.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
    4. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
    6. +-lowering-+.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
    7. associate-*l/N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
    8. *-lft-identityN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
    10. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
    11. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
    13. sub-negN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
    14. +-lowering-+.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
    16. metadata-eval99.8%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in a around inf

    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\color{blue}{a}, 9\right)\right)\right)\right)\right) \]
  6. Step-by-step derivation
    1. Simplified99.3%

      \[\leadsto \left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\color{blue}{a} \cdot 9}}\right) \]
    2. Add Preprocessing

    Alternative 9: 98.7% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \left(a + -0.3333333333333333\right) + \left(0.3333333333333333 \cdot rand\right) \cdot \sqrt{a} \end{array} \]
    (FPCore (a rand)
     :precision binary64
     (+ (+ a -0.3333333333333333) (* (* 0.3333333333333333 rand) (sqrt a))))
    double code(double a, double rand) {
    	return (a + -0.3333333333333333) + ((0.3333333333333333 * rand) * sqrt(a));
    }
    
    real(8) function code(a, rand)
        real(8), intent (in) :: a
        real(8), intent (in) :: rand
        code = (a + (-0.3333333333333333d0)) + ((0.3333333333333333d0 * rand) * sqrt(a))
    end function
    
    public static double code(double a, double rand) {
    	return (a + -0.3333333333333333) + ((0.3333333333333333 * rand) * Math.sqrt(a));
    }
    
    def code(a, rand):
    	return (a + -0.3333333333333333) + ((0.3333333333333333 * rand) * math.sqrt(a))
    
    function code(a, rand)
    	return Float64(Float64(a + -0.3333333333333333) + Float64(Float64(0.3333333333333333 * rand) * sqrt(a)))
    end
    
    function tmp = code(a, rand)
    	tmp = (a + -0.3333333333333333) + ((0.3333333333333333 * rand) * sqrt(a));
    end
    
    code[a_, rand_] := N[(N[(a + -0.3333333333333333), $MachinePrecision] + N[(N[(0.3333333333333333 * rand), $MachinePrecision] * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \left(a + -0.3333333333333333\right) + \left(0.3333333333333333 \cdot rand\right) \cdot \sqrt{a}
    \end{array}
    
    Derivation
    1. Initial program 99.8%

      \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
      7. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      16. metadata-eval99.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in rand around 0

      \[\leadsto \color{blue}{\left(a + \frac{1}{3} \cdot \left(rand \cdot \sqrt{a - \frac{1}{3}}\right)\right) - \frac{1}{3}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(\frac{1}{3} \cdot \left(rand \cdot \sqrt{a - \frac{1}{3}}\right) + a\right) - \frac{1}{3} \]
      2. associate--l+N/A

        \[\leadsto \frac{1}{3} \cdot \left(rand \cdot \sqrt{a - \frac{1}{3}}\right) + \color{blue}{\left(a - \frac{1}{3}\right)} \]
      3. metadata-evalN/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right) \cdot \left(rand \cdot \sqrt{a - \frac{1}{3}}\right) + \left(a - \frac{1}{3}\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{-1}{3} \cdot \left(rand \cdot \sqrt{a - \frac{1}{3}}\right)\right)\right) + \left(\color{blue}{a} - \frac{1}{3}\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{-1}{3} \cdot \left(\sqrt{a - \frac{1}{3}} \cdot rand\right)\right)\right) + \left(a - \frac{1}{3}\right) \]
      6. associate-*l*N/A

        \[\leadsto \left(\mathsf{neg}\left(\left(\frac{-1}{3} \cdot \sqrt{a - \frac{1}{3}}\right) \cdot rand\right)\right) + \left(a - \frac{1}{3}\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\mathsf{neg}\left(\left(\frac{-1}{3} \cdot \sqrt{a - \frac{1}{3}}\right) \cdot rand\right)\right), \color{blue}{\left(a - \frac{1}{3}\right)}\right) \]
    7. Simplified99.8%

      \[\leadsto \color{blue}{\sqrt{-0.3333333333333333 + a} \cdot \left(0.3333333333333333 \cdot rand\right) + \left(-0.3333333333333333 + a\right)} \]
    8. Taylor expanded in a around inf

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(\sqrt{a}\right)}, \mathsf{*.f64}\left(\frac{1}{3}, rand\right)\right), \mathsf{+.f64}\left(\frac{-1}{3}, a\right)\right) \]
    9. Step-by-step derivation
      1. sqrt-lowering-sqrt.f6499.3%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(a\right), \mathsf{*.f64}\left(\frac{1}{3}, rand\right)\right), \mathsf{+.f64}\left(\frac{-1}{3}, a\right)\right) \]
    10. Simplified99.3%

      \[\leadsto \color{blue}{\sqrt{a}} \cdot \left(0.3333333333333333 \cdot rand\right) + \left(-0.3333333333333333 + a\right) \]
    11. Final simplification99.3%

      \[\leadsto \left(a + -0.3333333333333333\right) + \left(0.3333333333333333 \cdot rand\right) \cdot \sqrt{a} \]
    12. Add Preprocessing

    Alternative 10: 97.6% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ a + \sqrt{a} \cdot \frac{rand}{3} \end{array} \]
    (FPCore (a rand) :precision binary64 (+ a (* (sqrt a) (/ rand 3.0))))
    double code(double a, double rand) {
    	return a + (sqrt(a) * (rand / 3.0));
    }
    
    real(8) function code(a, rand)
        real(8), intent (in) :: a
        real(8), intent (in) :: rand
        code = a + (sqrt(a) * (rand / 3.0d0))
    end function
    
    public static double code(double a, double rand) {
    	return a + (Math.sqrt(a) * (rand / 3.0));
    }
    
    def code(a, rand):
    	return a + (math.sqrt(a) * (rand / 3.0))
    
    function code(a, rand)
    	return Float64(a + Float64(sqrt(a) * Float64(rand / 3.0)))
    end
    
    function tmp = code(a, rand)
    	tmp = a + (sqrt(a) * (rand / 3.0));
    end
    
    code[a_, rand_] := N[(a + N[(N[Sqrt[a], $MachinePrecision] * N[(rand / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    a + \sqrt{a} \cdot \frac{rand}{3}
    \end{array}
    
    Derivation
    1. Initial program 99.8%

      \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
      7. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      16. metadata-eval99.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\frac{1}{3} \cdot \sqrt{\frac{1}{a}}\right) \cdot \color{blue}{rand}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\sqrt{\frac{1}{a}} \cdot \frac{1}{3}\right) \cdot rand\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{a}} \cdot \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{a}}\right), \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{a}\right)\right), \left(\color{blue}{\frac{1}{3}} \cdot rand\right)\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \left(\frac{1}{3} \cdot rand\right)\right)\right)\right) \]
      9. *-lowering-*.f6497.6%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{rand}\right)\right)\right)\right) \]
    7. Simplified97.6%

      \[\leadsto \color{blue}{a \cdot \left(1 + \sqrt{\frac{1}{a}} \cdot \left(0.3333333333333333 \cdot rand\right)\right)} \]
    8. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto a \cdot \left(\sqrt{\frac{1}{a}} \cdot \left(\frac{1}{3} \cdot rand\right) + \color{blue}{1}\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto \left(\sqrt{\frac{1}{a}} \cdot \left(\frac{1}{3} \cdot rand\right)\right) \cdot a + \color{blue}{1 \cdot a} \]
      3. *-lft-identityN/A

        \[\leadsto \left(\sqrt{\frac{1}{a}} \cdot \left(\frac{1}{3} \cdot rand\right)\right) \cdot a + a \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(\sqrt{\frac{1}{a}} \cdot \left(\frac{1}{3} \cdot rand\right)\right) \cdot a\right), \color{blue}{a}\right) \]
    9. Applied egg-rr97.7%

      \[\leadsto \color{blue}{\frac{rand}{3} \cdot \sqrt{a} + a} \]
    10. Final simplification97.7%

      \[\leadsto a + \sqrt{a} \cdot \frac{rand}{3} \]
    11. Add Preprocessing

    Alternative 11: 97.6% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ a + rand \cdot \frac{\sqrt{a}}{3} \end{array} \]
    (FPCore (a rand) :precision binary64 (+ a (* rand (/ (sqrt a) 3.0))))
    double code(double a, double rand) {
    	return a + (rand * (sqrt(a) / 3.0));
    }
    
    real(8) function code(a, rand)
        real(8), intent (in) :: a
        real(8), intent (in) :: rand
        code = a + (rand * (sqrt(a) / 3.0d0))
    end function
    
    public static double code(double a, double rand) {
    	return a + (rand * (Math.sqrt(a) / 3.0));
    }
    
    def code(a, rand):
    	return a + (rand * (math.sqrt(a) / 3.0))
    
    function code(a, rand)
    	return Float64(a + Float64(rand * Float64(sqrt(a) / 3.0)))
    end
    
    function tmp = code(a, rand)
    	tmp = a + (rand * (sqrt(a) / 3.0));
    end
    
    code[a_, rand_] := N[(a + N[(rand * N[(N[Sqrt[a], $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    a + rand \cdot \frac{\sqrt{a}}{3}
    \end{array}
    
    Derivation
    1. Initial program 99.8%

      \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
      7. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      16. metadata-eval99.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\frac{1}{3} \cdot \sqrt{\frac{1}{a}}\right) \cdot \color{blue}{rand}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\sqrt{\frac{1}{a}} \cdot \frac{1}{3}\right) \cdot rand\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{a}} \cdot \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{a}}\right), \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{a}\right)\right), \left(\color{blue}{\frac{1}{3}} \cdot rand\right)\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \left(\frac{1}{3} \cdot rand\right)\right)\right)\right) \]
      9. *-lowering-*.f6497.6%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{rand}\right)\right)\right)\right) \]
    7. Simplified97.6%

      \[\leadsto \color{blue}{a \cdot \left(1 + \sqrt{\frac{1}{a}} \cdot \left(0.3333333333333333 \cdot rand\right)\right)} \]
    8. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto a \cdot \left(\sqrt{\frac{1}{a}} \cdot \left(\frac{1}{3} \cdot rand\right) + \color{blue}{1}\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto \left(\sqrt{\frac{1}{a}} \cdot \left(\frac{1}{3} \cdot rand\right)\right) \cdot a + \color{blue}{1 \cdot a} \]
      3. *-lft-identityN/A

        \[\leadsto \left(\sqrt{\frac{1}{a}} \cdot \left(\frac{1}{3} \cdot rand\right)\right) \cdot a + a \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(\sqrt{\frac{1}{a}} \cdot \left(\frac{1}{3} \cdot rand\right)\right) \cdot a\right), \color{blue}{a}\right) \]
    9. Applied egg-rr97.7%

      \[\leadsto \color{blue}{\frac{rand}{3} \cdot \sqrt{a} + a} \]
    10. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{rand}{3} \cdot \sqrt{a}\right), \color{blue}{a}\right) \]
      2. associate-*l/N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{rand \cdot \sqrt{a}}{3}\right), a\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{+.f64}\left(\left(rand \cdot \frac{\sqrt{a}}{3}\right), a\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(rand, \left(\frac{\sqrt{a}}{3}\right)\right), a\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(rand, \mathsf{/.f64}\left(\left(\sqrt{a}\right), 3\right)\right), a\right) \]
      6. sqrt-lowering-sqrt.f6497.7%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(rand, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(a\right), 3\right)\right), a\right) \]
    11. Applied egg-rr97.7%

      \[\leadsto \color{blue}{rand \cdot \frac{\sqrt{a}}{3} + a} \]
    12. Final simplification97.7%

      \[\leadsto a + rand \cdot \frac{\sqrt{a}}{3} \]
    13. Add Preprocessing

    Alternative 12: 97.5% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ a + 0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right) \end{array} \]
    (FPCore (a rand)
     :precision binary64
     (+ a (* 0.3333333333333333 (* rand (sqrt a)))))
    double code(double a, double rand) {
    	return a + (0.3333333333333333 * (rand * sqrt(a)));
    }
    
    real(8) function code(a, rand)
        real(8), intent (in) :: a
        real(8), intent (in) :: rand
        code = a + (0.3333333333333333d0 * (rand * sqrt(a)))
    end function
    
    public static double code(double a, double rand) {
    	return a + (0.3333333333333333 * (rand * Math.sqrt(a)));
    }
    
    def code(a, rand):
    	return a + (0.3333333333333333 * (rand * math.sqrt(a)))
    
    function code(a, rand)
    	return Float64(a + Float64(0.3333333333333333 * Float64(rand * sqrt(a))))
    end
    
    function tmp = code(a, rand)
    	tmp = a + (0.3333333333333333 * (rand * sqrt(a)));
    end
    
    code[a_, rand_] := N[(a + N[(0.3333333333333333 * N[(rand * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    a + 0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)
    \end{array}
    
    Derivation
    1. Initial program 99.8%

      \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
      7. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
      16. metadata-eval99.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left(1 + \frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{3} \cdot \left(\sqrt{\frac{1}{a}} \cdot rand\right)\right)}\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\frac{1}{3} \cdot \sqrt{\frac{1}{a}}\right) \cdot \color{blue}{rand}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(\sqrt{\frac{1}{a}} \cdot \frac{1}{3}\right) \cdot rand\right)\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{a}} \cdot \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{a}}\right), \color{blue}{\left(\frac{1}{3} \cdot rand\right)}\right)\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{a}\right)\right), \left(\color{blue}{\frac{1}{3}} \cdot rand\right)\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \left(\frac{1}{3} \cdot rand\right)\right)\right)\right) \]
      9. *-lowering-*.f6497.6%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, a\right)\right), \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{rand}\right)\right)\right)\right) \]
    7. Simplified97.6%

      \[\leadsto \color{blue}{a \cdot \left(1 + \sqrt{\frac{1}{a}} \cdot \left(0.3333333333333333 \cdot rand\right)\right)} \]
    8. Taylor expanded in a around 0

      \[\leadsto \color{blue}{a + \frac{1}{3} \cdot \left(\sqrt{a} \cdot rand\right)} \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \color{blue}{\left(\frac{1}{3} \cdot \left(\sqrt{a} \cdot rand\right)\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{\left(\sqrt{a} \cdot rand\right)}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(\frac{1}{3}, \left(rand \cdot \color{blue}{\sqrt{a}}\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \color{blue}{\left(\sqrt{a}\right)}\right)\right)\right) \]
      5. sqrt-lowering-sqrt.f6497.7%

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(rand, \mathsf{sqrt.f64}\left(a\right)\right)\right)\right) \]
    10. Simplified97.7%

      \[\leadsto \color{blue}{a + 0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)} \]
    11. Add Preprocessing

    Alternative 13: 74.4% accurate, 5.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;rand \leq -6.5 \cdot 10^{+110}:\\ \;\;\;\;\left(0.1111111111111111 - a \cdot a\right) \cdot \left(a \cdot \left(9 + a \cdot \left(-27 + a \cdot 81\right)\right) + -3\right)\\ \mathbf{elif}\;rand \leq 5.7 \cdot 10^{+149}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)\\ \end{array} \end{array} \]
    (FPCore (a rand)
     :precision binary64
     (if (<= rand -6.5e+110)
       (*
        (- 0.1111111111111111 (* a a))
        (+ (* a (+ 9.0 (* a (+ -27.0 (* a 81.0))))) -3.0))
       (if (<= rand 5.7e+149)
         (+ a -0.3333333333333333)
         (* 27.0 (* a (* a (* a a)))))))
    double code(double a, double rand) {
    	double tmp;
    	if (rand <= -6.5e+110) {
    		tmp = (0.1111111111111111 - (a * a)) * ((a * (9.0 + (a * (-27.0 + (a * 81.0))))) + -3.0);
    	} else if (rand <= 5.7e+149) {
    		tmp = a + -0.3333333333333333;
    	} else {
    		tmp = 27.0 * (a * (a * (a * a)));
    	}
    	return tmp;
    }
    
    real(8) function code(a, rand)
        real(8), intent (in) :: a
        real(8), intent (in) :: rand
        real(8) :: tmp
        if (rand <= (-6.5d+110)) then
            tmp = (0.1111111111111111d0 - (a * a)) * ((a * (9.0d0 + (a * ((-27.0d0) + (a * 81.0d0))))) + (-3.0d0))
        else if (rand <= 5.7d+149) then
            tmp = a + (-0.3333333333333333d0)
        else
            tmp = 27.0d0 * (a * (a * (a * a)))
        end if
        code = tmp
    end function
    
    public static double code(double a, double rand) {
    	double tmp;
    	if (rand <= -6.5e+110) {
    		tmp = (0.1111111111111111 - (a * a)) * ((a * (9.0 + (a * (-27.0 + (a * 81.0))))) + -3.0);
    	} else if (rand <= 5.7e+149) {
    		tmp = a + -0.3333333333333333;
    	} else {
    		tmp = 27.0 * (a * (a * (a * a)));
    	}
    	return tmp;
    }
    
    def code(a, rand):
    	tmp = 0
    	if rand <= -6.5e+110:
    		tmp = (0.1111111111111111 - (a * a)) * ((a * (9.0 + (a * (-27.0 + (a * 81.0))))) + -3.0)
    	elif rand <= 5.7e+149:
    		tmp = a + -0.3333333333333333
    	else:
    		tmp = 27.0 * (a * (a * (a * a)))
    	return tmp
    
    function code(a, rand)
    	tmp = 0.0
    	if (rand <= -6.5e+110)
    		tmp = Float64(Float64(0.1111111111111111 - Float64(a * a)) * Float64(Float64(a * Float64(9.0 + Float64(a * Float64(-27.0 + Float64(a * 81.0))))) + -3.0));
    	elseif (rand <= 5.7e+149)
    		tmp = Float64(a + -0.3333333333333333);
    	else
    		tmp = Float64(27.0 * Float64(a * Float64(a * Float64(a * a))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, rand)
    	tmp = 0.0;
    	if (rand <= -6.5e+110)
    		tmp = (0.1111111111111111 - (a * a)) * ((a * (9.0 + (a * (-27.0 + (a * 81.0))))) + -3.0);
    	elseif (rand <= 5.7e+149)
    		tmp = a + -0.3333333333333333;
    	else
    		tmp = 27.0 * (a * (a * (a * a)));
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, rand_] := If[LessEqual[rand, -6.5e+110], N[(N[(0.1111111111111111 - N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(N[(a * N[(9.0 + N[(a * N[(-27.0 + N[(a * 81.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 5.7e+149], N[(a + -0.3333333333333333), $MachinePrecision], N[(27.0 * N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;rand \leq -6.5 \cdot 10^{+110}:\\
    \;\;\;\;\left(0.1111111111111111 - a \cdot a\right) \cdot \left(a \cdot \left(9 + a \cdot \left(-27 + a \cdot 81\right)\right) + -3\right)\\
    
    \mathbf{elif}\;rand \leq 5.7 \cdot 10^{+149}:\\
    \;\;\;\;a + -0.3333333333333333\\
    
    \mathbf{else}:\\
    \;\;\;\;27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if rand < -6.4999999999999997e110

      1. Initial program 99.5%

        \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
      2. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
        7. associate-*l/N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        8. *-lft-identityN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        9. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
        10. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
        12. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        14. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        16. metadata-eval99.6%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
      3. Simplified99.6%

        \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in rand around 0

        \[\leadsto \color{blue}{a - \frac{1}{3}} \]
      6. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
        2. metadata-evalN/A

          \[\leadsto a + \frac{-1}{3} \]
        3. +-commutativeN/A

          \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
        4. +-lowering-+.f641.0%

          \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
      7. Simplified1.0%

        \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
      8. Step-by-step derivation
        1. flip-+N/A

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a}{\color{blue}{\frac{-1}{3} - a}} \]
        2. div-invN/A

          \[\leadsto \left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right) \cdot \color{blue}{\frac{1}{\frac{-1}{3} - a}} \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right), \color{blue}{\left(\frac{1}{\frac{-1}{3} - a}\right)}\right) \]
        4. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3}\right), \left(a \cdot a\right)\right), \left(\frac{\color{blue}{1}}{\frac{-1}{3} - a}\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \left(a \cdot a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
        7. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{-1}{3} - a\right)}\right)\right) \]
        8. --lowering--.f640.5%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{-1}{3}, \color{blue}{a}\right)\right)\right) \]
      9. Applied egg-rr0.5%

        \[\leadsto \color{blue}{\left(0.1111111111111111 - a \cdot a\right) \cdot \frac{1}{-0.3333333333333333 - a}} \]
      10. Taylor expanded in a around 0

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \color{blue}{\left(a \cdot \left(9 + a \cdot \left(81 \cdot a - 27\right)\right) - 3\right)}\right) \]
      11. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(a \cdot \left(9 + a \cdot \left(81 \cdot a - 27\right)\right) + \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\left(a \cdot \left(9 + a \cdot \left(81 \cdot a - 27\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(9 + a \cdot \left(81 \cdot a - 27\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{3}\right)\right)\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \left(a \cdot \left(81 \cdot a - 27\right)\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, \left(81 \cdot a - 27\right)\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        6. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, \left(81 \cdot a + \left(\mathsf{neg}\left(27\right)\right)\right)\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        7. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, \left(81 \cdot a + -27\right)\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        8. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, \left(-27 + 81 \cdot a\right)\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        9. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(-27, \left(81 \cdot a\right)\right)\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        10. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(-27, \left(a \cdot 81\right)\right)\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        11. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(-27, \mathsf{*.f64}\left(a, 81\right)\right)\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        12. metadata-eval44.3%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(-27, \mathsf{*.f64}\left(a, 81\right)\right)\right)\right)\right), -3\right)\right) \]
      12. Simplified44.3%

        \[\leadsto \left(0.1111111111111111 - a \cdot a\right) \cdot \color{blue}{\left(a \cdot \left(9 + a \cdot \left(-27 + a \cdot 81\right)\right) + -3\right)} \]

      if -6.4999999999999997e110 < rand < 5.69999999999999965e149

      1. Initial program 99.9%

        \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
      2. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
        7. associate-*l/N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        8. *-lft-identityN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        9. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
        10. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
        12. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        14. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        16. metadata-eval99.9%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
      3. Simplified99.9%

        \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in rand around 0

        \[\leadsto \color{blue}{a - \frac{1}{3}} \]
      6. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
        2. metadata-evalN/A

          \[\leadsto a + \frac{-1}{3} \]
        3. +-commutativeN/A

          \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
        4. +-lowering-+.f6488.1%

          \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
      7. Simplified88.1%

        \[\leadsto \color{blue}{-0.3333333333333333 + a} \]

      if 5.69999999999999965e149 < rand

      1. Initial program 99.5%

        \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
      2. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
        7. associate-*l/N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        8. *-lft-identityN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        9. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
        10. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
        12. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        14. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        16. metadata-eval99.7%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
      3. Simplified99.7%

        \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in rand around 0

        \[\leadsto \color{blue}{a - \frac{1}{3}} \]
      6. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
        2. metadata-evalN/A

          \[\leadsto a + \frac{-1}{3} \]
        3. +-commutativeN/A

          \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
        4. +-lowering-+.f645.6%

          \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
      7. Simplified5.6%

        \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
      8. Step-by-step derivation
        1. flip-+N/A

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a}{\color{blue}{\frac{-1}{3} - a}} \]
        2. div-invN/A

          \[\leadsto \left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right) \cdot \color{blue}{\frac{1}{\frac{-1}{3} - a}} \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right), \color{blue}{\left(\frac{1}{\frac{-1}{3} - a}\right)}\right) \]
        4. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3}\right), \left(a \cdot a\right)\right), \left(\frac{\color{blue}{1}}{\frac{-1}{3} - a}\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \left(a \cdot a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
        7. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{-1}{3} - a\right)}\right)\right) \]
        8. --lowering--.f6436.7%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{-1}{3}, \color{blue}{a}\right)\right)\right) \]
      9. Applied egg-rr36.7%

        \[\leadsto \color{blue}{\left(0.1111111111111111 - a \cdot a\right) \cdot \frac{1}{-0.3333333333333333 - a}} \]
      10. Taylor expanded in a around 0

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \color{blue}{\left(a \cdot \left(9 + -27 \cdot a\right) - 3\right)}\right) \]
      11. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(a \cdot \left(9 + -27 \cdot a\right) + \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\left(a \cdot \left(9 + -27 \cdot a\right)\right), \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(9 + -27 \cdot a\right)\right), \left(\mathsf{neg}\left(\color{blue}{3}\right)\right)\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \left(-27 \cdot a\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        5. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \left(a \cdot -27\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, -27\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        7. metadata-eval38.5%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, -27\right)\right)\right), -3\right)\right) \]
      12. Simplified38.5%

        \[\leadsto \left(0.1111111111111111 - a \cdot a\right) \cdot \color{blue}{\left(a \cdot \left(9 + a \cdot -27\right) + -3\right)} \]
      13. Taylor expanded in a around inf

        \[\leadsto \color{blue}{27 \cdot {a}^{4}} \]
      14. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(27, \color{blue}{\left({a}^{4}\right)}\right) \]
        2. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(27, \left({a}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right) \]
        3. pow-sqrN/A

          \[\leadsto \mathsf{*.f64}\left(27, \left({a}^{2} \cdot \color{blue}{{a}^{2}}\right)\right) \]
        4. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(27, \left(\left(a \cdot a\right) \cdot {\color{blue}{a}}^{2}\right)\right) \]
        5. associate-*l*N/A

          \[\leadsto \mathsf{*.f64}\left(27, \left(a \cdot \color{blue}{\left(a \cdot {a}^{2}\right)}\right)\right) \]
        6. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(27, \left(a \cdot \left(a \cdot \left(a \cdot \color{blue}{a}\right)\right)\right)\right) \]
        7. cube-multN/A

          \[\leadsto \mathsf{*.f64}\left(27, \left(a \cdot {a}^{\color{blue}{3}}\right)\right) \]
        8. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \color{blue}{\left({a}^{3}\right)}\right)\right) \]
        9. cube-multN/A

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \left(a \cdot \color{blue}{\left(a \cdot a\right)}\right)\right)\right) \]
        10. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \left(a \cdot {a}^{\color{blue}{2}}\right)\right)\right) \]
        11. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{\left({a}^{2}\right)}\right)\right)\right) \]
        12. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(a \cdot \color{blue}{a}\right)\right)\right)\right) \]
        13. *-lowering-*.f6438.5%

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{a}\right)\right)\right)\right) \]
      15. Simplified38.5%

        \[\leadsto \color{blue}{27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification75.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;rand \leq -6.5 \cdot 10^{+110}:\\ \;\;\;\;\left(0.1111111111111111 - a \cdot a\right) \cdot \left(a \cdot \left(9 + a \cdot \left(-27 + a \cdot 81\right)\right) + -3\right)\\ \mathbf{elif}\;rand \leq 5.7 \cdot 10^{+149}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 14: 73.9% accurate, 6.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;rand \leq -6.5 \cdot 10^{+110}:\\ \;\;\;\;-0.3333333333333333 + a \cdot \left(1 + \left(a \cdot a\right) \cdot -9\right)\\ \mathbf{elif}\;rand \leq 3.4 \cdot 10^{+146}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)\\ \end{array} \end{array} \]
    (FPCore (a rand)
     :precision binary64
     (if (<= rand -6.5e+110)
       (+ -0.3333333333333333 (* a (+ 1.0 (* (* a a) -9.0))))
       (if (<= rand 3.4e+146)
         (+ a -0.3333333333333333)
         (* 27.0 (* a (* a (* a a)))))))
    double code(double a, double rand) {
    	double tmp;
    	if (rand <= -6.5e+110) {
    		tmp = -0.3333333333333333 + (a * (1.0 + ((a * a) * -9.0)));
    	} else if (rand <= 3.4e+146) {
    		tmp = a + -0.3333333333333333;
    	} else {
    		tmp = 27.0 * (a * (a * (a * a)));
    	}
    	return tmp;
    }
    
    real(8) function code(a, rand)
        real(8), intent (in) :: a
        real(8), intent (in) :: rand
        real(8) :: tmp
        if (rand <= (-6.5d+110)) then
            tmp = (-0.3333333333333333d0) + (a * (1.0d0 + ((a * a) * (-9.0d0))))
        else if (rand <= 3.4d+146) then
            tmp = a + (-0.3333333333333333d0)
        else
            tmp = 27.0d0 * (a * (a * (a * a)))
        end if
        code = tmp
    end function
    
    public static double code(double a, double rand) {
    	double tmp;
    	if (rand <= -6.5e+110) {
    		tmp = -0.3333333333333333 + (a * (1.0 + ((a * a) * -9.0)));
    	} else if (rand <= 3.4e+146) {
    		tmp = a + -0.3333333333333333;
    	} else {
    		tmp = 27.0 * (a * (a * (a * a)));
    	}
    	return tmp;
    }
    
    def code(a, rand):
    	tmp = 0
    	if rand <= -6.5e+110:
    		tmp = -0.3333333333333333 + (a * (1.0 + ((a * a) * -9.0)))
    	elif rand <= 3.4e+146:
    		tmp = a + -0.3333333333333333
    	else:
    		tmp = 27.0 * (a * (a * (a * a)))
    	return tmp
    
    function code(a, rand)
    	tmp = 0.0
    	if (rand <= -6.5e+110)
    		tmp = Float64(-0.3333333333333333 + Float64(a * Float64(1.0 + Float64(Float64(a * a) * -9.0))));
    	elseif (rand <= 3.4e+146)
    		tmp = Float64(a + -0.3333333333333333);
    	else
    		tmp = Float64(27.0 * Float64(a * Float64(a * Float64(a * a))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, rand)
    	tmp = 0.0;
    	if (rand <= -6.5e+110)
    		tmp = -0.3333333333333333 + (a * (1.0 + ((a * a) * -9.0)));
    	elseif (rand <= 3.4e+146)
    		tmp = a + -0.3333333333333333;
    	else
    		tmp = 27.0 * (a * (a * (a * a)));
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, rand_] := If[LessEqual[rand, -6.5e+110], N[(-0.3333333333333333 + N[(a * N[(1.0 + N[(N[(a * a), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 3.4e+146], N[(a + -0.3333333333333333), $MachinePrecision], N[(27.0 * N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;rand \leq -6.5 \cdot 10^{+110}:\\
    \;\;\;\;-0.3333333333333333 + a \cdot \left(1 + \left(a \cdot a\right) \cdot -9\right)\\
    
    \mathbf{elif}\;rand \leq 3.4 \cdot 10^{+146}:\\
    \;\;\;\;a + -0.3333333333333333\\
    
    \mathbf{else}:\\
    \;\;\;\;27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if rand < -6.4999999999999997e110

      1. Initial program 99.5%

        \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
      2. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
        7. associate-*l/N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        8. *-lft-identityN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        9. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
        10. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
        12. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        14. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        16. metadata-eval99.6%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
      3. Simplified99.6%

        \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in rand around 0

        \[\leadsto \color{blue}{a - \frac{1}{3}} \]
      6. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
        2. metadata-evalN/A

          \[\leadsto a + \frac{-1}{3} \]
        3. +-commutativeN/A

          \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
        4. +-lowering-+.f641.0%

          \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
      7. Simplified1.0%

        \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
      8. Step-by-step derivation
        1. flip-+N/A

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a}{\color{blue}{\frac{-1}{3} - a}} \]
        2. div-invN/A

          \[\leadsto \left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right) \cdot \color{blue}{\frac{1}{\frac{-1}{3} - a}} \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right), \color{blue}{\left(\frac{1}{\frac{-1}{3} - a}\right)}\right) \]
        4. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3}\right), \left(a \cdot a\right)\right), \left(\frac{\color{blue}{1}}{\frac{-1}{3} - a}\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \left(a \cdot a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
        7. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{-1}{3} - a\right)}\right)\right) \]
        8. --lowering--.f640.5%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{-1}{3}, \color{blue}{a}\right)\right)\right) \]
      9. Applied egg-rr0.5%

        \[\leadsto \color{blue}{\left(0.1111111111111111 - a \cdot a\right) \cdot \frac{1}{-0.3333333333333333 - a}} \]
      10. Taylor expanded in a around 0

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \color{blue}{\left(a \cdot \left(9 + -27 \cdot a\right) - 3\right)}\right) \]
      11. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(a \cdot \left(9 + -27 \cdot a\right) + \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\left(a \cdot \left(9 + -27 \cdot a\right)\right), \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(9 + -27 \cdot a\right)\right), \left(\mathsf{neg}\left(\color{blue}{3}\right)\right)\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \left(-27 \cdot a\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        5. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \left(a \cdot -27\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, -27\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        7. metadata-eval0.4%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, -27\right)\right)\right), -3\right)\right) \]
      12. Simplified0.4%

        \[\leadsto \left(0.1111111111111111 - a \cdot a\right) \cdot \color{blue}{\left(a \cdot \left(9 + a \cdot -27\right) + -3\right)} \]
      13. Taylor expanded in a around 0

        \[\leadsto \color{blue}{a \cdot \left(1 + -9 \cdot {a}^{2}\right) - \frac{1}{3}} \]
      14. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto a \cdot \left(1 + -9 \cdot {a}^{2}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
        2. metadata-evalN/A

          \[\leadsto a \cdot \left(1 + -9 \cdot {a}^{2}\right) + \frac{-1}{3} \]
        3. +-commutativeN/A

          \[\leadsto \frac{-1}{3} + \color{blue}{a \cdot \left(1 + -9 \cdot {a}^{2}\right)} \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{\left(a \cdot \left(1 + -9 \cdot {a}^{2}\right)\right)}\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(a, \color{blue}{\left(1 + -9 \cdot {a}^{2}\right)}\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(-9 \cdot {a}^{2}\right)}\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(-9, \color{blue}{\left({a}^{2}\right)}\right)\right)\right)\right) \]
        8. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(-9, \left(a \cdot \color{blue}{a}\right)\right)\right)\right)\right) \]
        9. *-lowering-*.f6437.7%

          \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(-9, \mathsf{*.f64}\left(a, \color{blue}{a}\right)\right)\right)\right)\right) \]
      15. Simplified37.7%

        \[\leadsto \color{blue}{-0.3333333333333333 + a \cdot \left(1 + -9 \cdot \left(a \cdot a\right)\right)} \]

      if -6.4999999999999997e110 < rand < 3.39999999999999991e146

      1. Initial program 99.9%

        \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
      2. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
        7. associate-*l/N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        8. *-lft-identityN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        9. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
        10. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
        12. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        14. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        16. metadata-eval99.9%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
      3. Simplified99.9%

        \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in rand around 0

        \[\leadsto \color{blue}{a - \frac{1}{3}} \]
      6. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
        2. metadata-evalN/A

          \[\leadsto a + \frac{-1}{3} \]
        3. +-commutativeN/A

          \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
        4. +-lowering-+.f6488.1%

          \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
      7. Simplified88.1%

        \[\leadsto \color{blue}{-0.3333333333333333 + a} \]

      if 3.39999999999999991e146 < rand

      1. Initial program 99.5%

        \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
      2. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
        7. associate-*l/N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        8. *-lft-identityN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        9. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
        10. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
        12. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        14. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        16. metadata-eval99.7%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
      3. Simplified99.7%

        \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in rand around 0

        \[\leadsto \color{blue}{a - \frac{1}{3}} \]
      6. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
        2. metadata-evalN/A

          \[\leadsto a + \frac{-1}{3} \]
        3. +-commutativeN/A

          \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
        4. +-lowering-+.f645.6%

          \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
      7. Simplified5.6%

        \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
      8. Step-by-step derivation
        1. flip-+N/A

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a}{\color{blue}{\frac{-1}{3} - a}} \]
        2. div-invN/A

          \[\leadsto \left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right) \cdot \color{blue}{\frac{1}{\frac{-1}{3} - a}} \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right), \color{blue}{\left(\frac{1}{\frac{-1}{3} - a}\right)}\right) \]
        4. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3}\right), \left(a \cdot a\right)\right), \left(\frac{\color{blue}{1}}{\frac{-1}{3} - a}\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \left(a \cdot a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
        7. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{-1}{3} - a\right)}\right)\right) \]
        8. --lowering--.f6436.7%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{-1}{3}, \color{blue}{a}\right)\right)\right) \]
      9. Applied egg-rr36.7%

        \[\leadsto \color{blue}{\left(0.1111111111111111 - a \cdot a\right) \cdot \frac{1}{-0.3333333333333333 - a}} \]
      10. Taylor expanded in a around 0

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \color{blue}{\left(a \cdot \left(9 + -27 \cdot a\right) - 3\right)}\right) \]
      11. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(a \cdot \left(9 + -27 \cdot a\right) + \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\left(a \cdot \left(9 + -27 \cdot a\right)\right), \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(9 + -27 \cdot a\right)\right), \left(\mathsf{neg}\left(\color{blue}{3}\right)\right)\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \left(-27 \cdot a\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        5. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \left(a \cdot -27\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, -27\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        7. metadata-eval38.5%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, -27\right)\right)\right), -3\right)\right) \]
      12. Simplified38.5%

        \[\leadsto \left(0.1111111111111111 - a \cdot a\right) \cdot \color{blue}{\left(a \cdot \left(9 + a \cdot -27\right) + -3\right)} \]
      13. Taylor expanded in a around inf

        \[\leadsto \color{blue}{27 \cdot {a}^{4}} \]
      14. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(27, \color{blue}{\left({a}^{4}\right)}\right) \]
        2. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(27, \left({a}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right) \]
        3. pow-sqrN/A

          \[\leadsto \mathsf{*.f64}\left(27, \left({a}^{2} \cdot \color{blue}{{a}^{2}}\right)\right) \]
        4. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(27, \left(\left(a \cdot a\right) \cdot {\color{blue}{a}}^{2}\right)\right) \]
        5. associate-*l*N/A

          \[\leadsto \mathsf{*.f64}\left(27, \left(a \cdot \color{blue}{\left(a \cdot {a}^{2}\right)}\right)\right) \]
        6. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(27, \left(a \cdot \left(a \cdot \left(a \cdot \color{blue}{a}\right)\right)\right)\right) \]
        7. cube-multN/A

          \[\leadsto \mathsf{*.f64}\left(27, \left(a \cdot {a}^{\color{blue}{3}}\right)\right) \]
        8. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \color{blue}{\left({a}^{3}\right)}\right)\right) \]
        9. cube-multN/A

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \left(a \cdot \color{blue}{\left(a \cdot a\right)}\right)\right)\right) \]
        10. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \left(a \cdot {a}^{\color{blue}{2}}\right)\right)\right) \]
        11. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{\left({a}^{2}\right)}\right)\right)\right) \]
        12. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(a \cdot \color{blue}{a}\right)\right)\right)\right) \]
        13. *-lowering-*.f6438.5%

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{a}\right)\right)\right)\right) \]
      15. Simplified38.5%

        \[\leadsto \color{blue}{27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification74.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;rand \leq -6.5 \cdot 10^{+110}:\\ \;\;\;\;-0.3333333333333333 + a \cdot \left(1 + \left(a \cdot a\right) \cdot -9\right)\\ \mathbf{elif}\;rand \leq 3.4 \cdot 10^{+146}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 15: 73.9% accurate, 6.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;rand \leq -6.5 \cdot 10^{+110}:\\ \;\;\;\;\left(0.1111111111111111 - a \cdot a\right) \cdot \left(a \cdot 9 + -3\right)\\ \mathbf{elif}\;rand \leq 8.5 \cdot 10^{+148}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)\\ \end{array} \end{array} \]
    (FPCore (a rand)
     :precision binary64
     (if (<= rand -6.5e+110)
       (* (- 0.1111111111111111 (* a a)) (+ (* a 9.0) -3.0))
       (if (<= rand 8.5e+148)
         (+ a -0.3333333333333333)
         (* 27.0 (* a (* a (* a a)))))))
    double code(double a, double rand) {
    	double tmp;
    	if (rand <= -6.5e+110) {
    		tmp = (0.1111111111111111 - (a * a)) * ((a * 9.0) + -3.0);
    	} else if (rand <= 8.5e+148) {
    		tmp = a + -0.3333333333333333;
    	} else {
    		tmp = 27.0 * (a * (a * (a * a)));
    	}
    	return tmp;
    }
    
    real(8) function code(a, rand)
        real(8), intent (in) :: a
        real(8), intent (in) :: rand
        real(8) :: tmp
        if (rand <= (-6.5d+110)) then
            tmp = (0.1111111111111111d0 - (a * a)) * ((a * 9.0d0) + (-3.0d0))
        else if (rand <= 8.5d+148) then
            tmp = a + (-0.3333333333333333d0)
        else
            tmp = 27.0d0 * (a * (a * (a * a)))
        end if
        code = tmp
    end function
    
    public static double code(double a, double rand) {
    	double tmp;
    	if (rand <= -6.5e+110) {
    		tmp = (0.1111111111111111 - (a * a)) * ((a * 9.0) + -3.0);
    	} else if (rand <= 8.5e+148) {
    		tmp = a + -0.3333333333333333;
    	} else {
    		tmp = 27.0 * (a * (a * (a * a)));
    	}
    	return tmp;
    }
    
    def code(a, rand):
    	tmp = 0
    	if rand <= -6.5e+110:
    		tmp = (0.1111111111111111 - (a * a)) * ((a * 9.0) + -3.0)
    	elif rand <= 8.5e+148:
    		tmp = a + -0.3333333333333333
    	else:
    		tmp = 27.0 * (a * (a * (a * a)))
    	return tmp
    
    function code(a, rand)
    	tmp = 0.0
    	if (rand <= -6.5e+110)
    		tmp = Float64(Float64(0.1111111111111111 - Float64(a * a)) * Float64(Float64(a * 9.0) + -3.0));
    	elseif (rand <= 8.5e+148)
    		tmp = Float64(a + -0.3333333333333333);
    	else
    		tmp = Float64(27.0 * Float64(a * Float64(a * Float64(a * a))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, rand)
    	tmp = 0.0;
    	if (rand <= -6.5e+110)
    		tmp = (0.1111111111111111 - (a * a)) * ((a * 9.0) + -3.0);
    	elseif (rand <= 8.5e+148)
    		tmp = a + -0.3333333333333333;
    	else
    		tmp = 27.0 * (a * (a * (a * a)));
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, rand_] := If[LessEqual[rand, -6.5e+110], N[(N[(0.1111111111111111 - N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(N[(a * 9.0), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 8.5e+148], N[(a + -0.3333333333333333), $MachinePrecision], N[(27.0 * N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;rand \leq -6.5 \cdot 10^{+110}:\\
    \;\;\;\;\left(0.1111111111111111 - a \cdot a\right) \cdot \left(a \cdot 9 + -3\right)\\
    
    \mathbf{elif}\;rand \leq 8.5 \cdot 10^{+148}:\\
    \;\;\;\;a + -0.3333333333333333\\
    
    \mathbf{else}:\\
    \;\;\;\;27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if rand < -6.4999999999999997e110

      1. Initial program 99.5%

        \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
      2. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
        7. associate-*l/N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        8. *-lft-identityN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        9. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
        10. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
        12. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        14. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        16. metadata-eval99.6%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
      3. Simplified99.6%

        \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in rand around 0

        \[\leadsto \color{blue}{a - \frac{1}{3}} \]
      6. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
        2. metadata-evalN/A

          \[\leadsto a + \frac{-1}{3} \]
        3. +-commutativeN/A

          \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
        4. +-lowering-+.f641.0%

          \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
      7. Simplified1.0%

        \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
      8. Step-by-step derivation
        1. flip-+N/A

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a}{\color{blue}{\frac{-1}{3} - a}} \]
        2. div-invN/A

          \[\leadsto \left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right) \cdot \color{blue}{\frac{1}{\frac{-1}{3} - a}} \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right), \color{blue}{\left(\frac{1}{\frac{-1}{3} - a}\right)}\right) \]
        4. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3}\right), \left(a \cdot a\right)\right), \left(\frac{\color{blue}{1}}{\frac{-1}{3} - a}\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \left(a \cdot a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
        7. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{-1}{3} - a\right)}\right)\right) \]
        8. --lowering--.f640.5%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{-1}{3}, \color{blue}{a}\right)\right)\right) \]
      9. Applied egg-rr0.5%

        \[\leadsto \color{blue}{\left(0.1111111111111111 - a \cdot a\right) \cdot \frac{1}{-0.3333333333333333 - a}} \]
      10. Taylor expanded in a around 0

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \color{blue}{\left(9 \cdot a - 3\right)}\right) \]
      11. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(9 \cdot a + \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\left(9 \cdot a\right), \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
        3. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\left(a \cdot 9\right), \left(\mathsf{neg}\left(\color{blue}{3}\right)\right)\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, 9\right), \left(\mathsf{neg}\left(\color{blue}{3}\right)\right)\right)\right) \]
        5. metadata-eval37.7%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, 9\right), -3\right)\right) \]
      12. Simplified37.7%

        \[\leadsto \left(0.1111111111111111 - a \cdot a\right) \cdot \color{blue}{\left(a \cdot 9 + -3\right)} \]

      if -6.4999999999999997e110 < rand < 8.4999999999999996e148

      1. Initial program 99.9%

        \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
      2. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
        7. associate-*l/N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        8. *-lft-identityN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        9. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
        10. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
        12. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        14. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        16. metadata-eval99.9%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
      3. Simplified99.9%

        \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in rand around 0

        \[\leadsto \color{blue}{a - \frac{1}{3}} \]
      6. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
        2. metadata-evalN/A

          \[\leadsto a + \frac{-1}{3} \]
        3. +-commutativeN/A

          \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
        4. +-lowering-+.f6488.1%

          \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
      7. Simplified88.1%

        \[\leadsto \color{blue}{-0.3333333333333333 + a} \]

      if 8.4999999999999996e148 < rand

      1. Initial program 99.5%

        \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
      2. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
        7. associate-*l/N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        8. *-lft-identityN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        9. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
        10. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
        12. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        14. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        16. metadata-eval99.7%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
      3. Simplified99.7%

        \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in rand around 0

        \[\leadsto \color{blue}{a - \frac{1}{3}} \]
      6. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
        2. metadata-evalN/A

          \[\leadsto a + \frac{-1}{3} \]
        3. +-commutativeN/A

          \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
        4. +-lowering-+.f645.6%

          \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
      7. Simplified5.6%

        \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
      8. Step-by-step derivation
        1. flip-+N/A

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a}{\color{blue}{\frac{-1}{3} - a}} \]
        2. div-invN/A

          \[\leadsto \left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right) \cdot \color{blue}{\frac{1}{\frac{-1}{3} - a}} \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right), \color{blue}{\left(\frac{1}{\frac{-1}{3} - a}\right)}\right) \]
        4. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3}\right), \left(a \cdot a\right)\right), \left(\frac{\color{blue}{1}}{\frac{-1}{3} - a}\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \left(a \cdot a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
        7. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{-1}{3} - a\right)}\right)\right) \]
        8. --lowering--.f6436.7%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{-1}{3}, \color{blue}{a}\right)\right)\right) \]
      9. Applied egg-rr36.7%

        \[\leadsto \color{blue}{\left(0.1111111111111111 - a \cdot a\right) \cdot \frac{1}{-0.3333333333333333 - a}} \]
      10. Taylor expanded in a around 0

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \color{blue}{\left(a \cdot \left(9 + -27 \cdot a\right) - 3\right)}\right) \]
      11. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(a \cdot \left(9 + -27 \cdot a\right) + \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\left(a \cdot \left(9 + -27 \cdot a\right)\right), \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(9 + -27 \cdot a\right)\right), \left(\mathsf{neg}\left(\color{blue}{3}\right)\right)\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \left(-27 \cdot a\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        5. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \left(a \cdot -27\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, -27\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        7. metadata-eval38.5%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, -27\right)\right)\right), -3\right)\right) \]
      12. Simplified38.5%

        \[\leadsto \left(0.1111111111111111 - a \cdot a\right) \cdot \color{blue}{\left(a \cdot \left(9 + a \cdot -27\right) + -3\right)} \]
      13. Taylor expanded in a around inf

        \[\leadsto \color{blue}{27 \cdot {a}^{4}} \]
      14. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(27, \color{blue}{\left({a}^{4}\right)}\right) \]
        2. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(27, \left({a}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right) \]
        3. pow-sqrN/A

          \[\leadsto \mathsf{*.f64}\left(27, \left({a}^{2} \cdot \color{blue}{{a}^{2}}\right)\right) \]
        4. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(27, \left(\left(a \cdot a\right) \cdot {\color{blue}{a}}^{2}\right)\right) \]
        5. associate-*l*N/A

          \[\leadsto \mathsf{*.f64}\left(27, \left(a \cdot \color{blue}{\left(a \cdot {a}^{2}\right)}\right)\right) \]
        6. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(27, \left(a \cdot \left(a \cdot \left(a \cdot \color{blue}{a}\right)\right)\right)\right) \]
        7. cube-multN/A

          \[\leadsto \mathsf{*.f64}\left(27, \left(a \cdot {a}^{\color{blue}{3}}\right)\right) \]
        8. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \color{blue}{\left({a}^{3}\right)}\right)\right) \]
        9. cube-multN/A

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \left(a \cdot \color{blue}{\left(a \cdot a\right)}\right)\right)\right) \]
        10. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \left(a \cdot {a}^{\color{blue}{2}}\right)\right)\right) \]
        11. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{\left({a}^{2}\right)}\right)\right)\right) \]
        12. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(a \cdot \color{blue}{a}\right)\right)\right)\right) \]
        13. *-lowering-*.f6438.5%

          \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{a}\right)\right)\right)\right) \]
      15. Simplified38.5%

        \[\leadsto \color{blue}{27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification74.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;rand \leq -6.5 \cdot 10^{+110}:\\ \;\;\;\;\left(0.1111111111111111 - a \cdot a\right) \cdot \left(a \cdot 9 + -3\right)\\ \mathbf{elif}\;rand \leq 8.5 \cdot 10^{+148}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 16: 72.9% accurate, 6.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;rand \leq -6.5 \cdot 10^{+110}:\\ \;\;\;\;0.1111111111111111 \cdot \left(-3 + a \cdot \left(9 + a \cdot -27\right)\right)\\ \mathbf{elif}\;rand \leq 1.8 \cdot 10^{+148}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)\\ \end{array} \end{array} \]
    (FPCore (a rand)
     :precision binary64
     (if (<= rand -6.5e+110)
       (* 0.1111111111111111 (+ -3.0 (* a (+ 9.0 (* a -27.0)))))
       (if (<= rand 1.8e+148)
         (+ a -0.3333333333333333)
         (* 27.0 (* a (* a (* a a)))))))
    double code(double a, double rand) {
    	double tmp;
    	if (rand <= -6.5e+110) {
    		tmp = 0.1111111111111111 * (-3.0 + (a * (9.0 + (a * -27.0))));
    	} else if (rand <= 1.8e+148) {
    		tmp = a + -0.3333333333333333;
    	} else {
    		tmp = 27.0 * (a * (a * (a * a)));
    	}
    	return tmp;
    }
    
    real(8) function code(a, rand)
        real(8), intent (in) :: a
        real(8), intent (in) :: rand
        real(8) :: tmp
        if (rand <= (-6.5d+110)) then
            tmp = 0.1111111111111111d0 * ((-3.0d0) + (a * (9.0d0 + (a * (-27.0d0)))))
        else if (rand <= 1.8d+148) then
            tmp = a + (-0.3333333333333333d0)
        else
            tmp = 27.0d0 * (a * (a * (a * a)))
        end if
        code = tmp
    end function
    
    public static double code(double a, double rand) {
    	double tmp;
    	if (rand <= -6.5e+110) {
    		tmp = 0.1111111111111111 * (-3.0 + (a * (9.0 + (a * -27.0))));
    	} else if (rand <= 1.8e+148) {
    		tmp = a + -0.3333333333333333;
    	} else {
    		tmp = 27.0 * (a * (a * (a * a)));
    	}
    	return tmp;
    }
    
    def code(a, rand):
    	tmp = 0
    	if rand <= -6.5e+110:
    		tmp = 0.1111111111111111 * (-3.0 + (a * (9.0 + (a * -27.0))))
    	elif rand <= 1.8e+148:
    		tmp = a + -0.3333333333333333
    	else:
    		tmp = 27.0 * (a * (a * (a * a)))
    	return tmp
    
    function code(a, rand)
    	tmp = 0.0
    	if (rand <= -6.5e+110)
    		tmp = Float64(0.1111111111111111 * Float64(-3.0 + Float64(a * Float64(9.0 + Float64(a * -27.0)))));
    	elseif (rand <= 1.8e+148)
    		tmp = Float64(a + -0.3333333333333333);
    	else
    		tmp = Float64(27.0 * Float64(a * Float64(a * Float64(a * a))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, rand)
    	tmp = 0.0;
    	if (rand <= -6.5e+110)
    		tmp = 0.1111111111111111 * (-3.0 + (a * (9.0 + (a * -27.0))));
    	elseif (rand <= 1.8e+148)
    		tmp = a + -0.3333333333333333;
    	else
    		tmp = 27.0 * (a * (a * (a * a)));
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, rand_] := If[LessEqual[rand, -6.5e+110], N[(0.1111111111111111 * N[(-3.0 + N[(a * N[(9.0 + N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 1.8e+148], N[(a + -0.3333333333333333), $MachinePrecision], N[(27.0 * N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;rand \leq -6.5 \cdot 10^{+110}:\\
    \;\;\;\;0.1111111111111111 \cdot \left(-3 + a \cdot \left(9 + a \cdot -27\right)\right)\\
    
    \mathbf{elif}\;rand \leq 1.8 \cdot 10^{+148}:\\
    \;\;\;\;a + -0.3333333333333333\\
    
    \mathbf{else}:\\
    \;\;\;\;27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if rand < -6.4999999999999997e110

      1. Initial program 99.5%

        \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
      2. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
        7. associate-*l/N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        8. *-lft-identityN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
        9. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
        10. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
        12. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        14. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
        16. metadata-eval99.6%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
      3. Simplified99.6%

        \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in rand around 0

        \[\leadsto \color{blue}{a - \frac{1}{3}} \]
      6. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
        2. metadata-evalN/A

          \[\leadsto a + \frac{-1}{3} \]
        3. +-commutativeN/A

          \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
        4. +-lowering-+.f641.0%

          \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
      7. Simplified1.0%

        \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
      8. Step-by-step derivation
        1. flip-+N/A

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a}{\color{blue}{\frac{-1}{3} - a}} \]
        2. div-invN/A

          \[\leadsto \left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right) \cdot \color{blue}{\frac{1}{\frac{-1}{3} - a}} \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right), \color{blue}{\left(\frac{1}{\frac{-1}{3} - a}\right)}\right) \]
        4. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3}\right), \left(a \cdot a\right)\right), \left(\frac{\color{blue}{1}}{\frac{-1}{3} - a}\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \left(a \cdot a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
        7. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{-1}{3} - a\right)}\right)\right) \]
        8. --lowering--.f640.5%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{-1}{3}, \color{blue}{a}\right)\right)\right) \]
      9. Applied egg-rr0.5%

        \[\leadsto \color{blue}{\left(0.1111111111111111 - a \cdot a\right) \cdot \frac{1}{-0.3333333333333333 - a}} \]
      10. Taylor expanded in a around 0

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \color{blue}{\left(a \cdot \left(9 + -27 \cdot a\right) - 3\right)}\right) \]
      11. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(a \cdot \left(9 + -27 \cdot a\right) + \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\left(a \cdot \left(9 + -27 \cdot a\right)\right), \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(9 + -27 \cdot a\right)\right), \left(\mathsf{neg}\left(\color{blue}{3}\right)\right)\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \left(-27 \cdot a\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        5. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \left(a \cdot -27\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, -27\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
        7. metadata-eval0.4%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, -27\right)\right)\right), -3\right)\right) \]
      12. Simplified0.4%

        \[\leadsto \left(0.1111111111111111 - a \cdot a\right) \cdot \color{blue}{\left(a \cdot \left(9 + a \cdot -27\right) + -3\right)} \]
      13. Taylor expanded in a around 0

        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\frac{1}{9}}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, -27\right)\right)\right), -3\right)\right) \]
      14. Step-by-step derivation
        1. Simplified33.3%

          \[\leadsto \color{blue}{0.1111111111111111} \cdot \left(a \cdot \left(9 + a \cdot -27\right) + -3\right) \]

        if -6.4999999999999997e110 < rand < 1.80000000000000003e148

        1. Initial program 99.9%

          \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
        2. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          4. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          6. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
          7. associate-*l/N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
          8. *-lft-identityN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
          9. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
          10. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
          11. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
          13. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          14. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          15. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          16. metadata-eval99.9%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
        3. Simplified99.9%

          \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in rand around 0

          \[\leadsto \color{blue}{a - \frac{1}{3}} \]
        6. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
          2. metadata-evalN/A

            \[\leadsto a + \frac{-1}{3} \]
          3. +-commutativeN/A

            \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
          4. +-lowering-+.f6488.1%

            \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
        7. Simplified88.1%

          \[\leadsto \color{blue}{-0.3333333333333333 + a} \]

        if 1.80000000000000003e148 < rand

        1. Initial program 99.5%

          \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
        2. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          4. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          6. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
          7. associate-*l/N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
          8. *-lft-identityN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
          9. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
          10. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
          11. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
          13. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          14. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          15. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          16. metadata-eval99.7%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
        3. Simplified99.7%

          \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in rand around 0

          \[\leadsto \color{blue}{a - \frac{1}{3}} \]
        6. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
          2. metadata-evalN/A

            \[\leadsto a + \frac{-1}{3} \]
          3. +-commutativeN/A

            \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
          4. +-lowering-+.f645.6%

            \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
        7. Simplified5.6%

          \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
        8. Step-by-step derivation
          1. flip-+N/A

            \[\leadsto \frac{\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a}{\color{blue}{\frac{-1}{3} - a}} \]
          2. div-invN/A

            \[\leadsto \left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right) \cdot \color{blue}{\frac{1}{\frac{-1}{3} - a}} \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right), \color{blue}{\left(\frac{1}{\frac{-1}{3} - a}\right)}\right) \]
          4. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3}\right), \left(a \cdot a\right)\right), \left(\frac{\color{blue}{1}}{\frac{-1}{3} - a}\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \left(a \cdot a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
          7. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{-1}{3} - a\right)}\right)\right) \]
          8. --lowering--.f6436.7%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{-1}{3}, \color{blue}{a}\right)\right)\right) \]
        9. Applied egg-rr36.7%

          \[\leadsto \color{blue}{\left(0.1111111111111111 - a \cdot a\right) \cdot \frac{1}{-0.3333333333333333 - a}} \]
        10. Taylor expanded in a around 0

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \color{blue}{\left(a \cdot \left(9 + -27 \cdot a\right) - 3\right)}\right) \]
        11. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(a \cdot \left(9 + -27 \cdot a\right) + \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
          2. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\left(a \cdot \left(9 + -27 \cdot a\right)\right), \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(9 + -27 \cdot a\right)\right), \left(\mathsf{neg}\left(\color{blue}{3}\right)\right)\right)\right) \]
          4. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \left(-27 \cdot a\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \left(a \cdot -27\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, -27\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
          7. metadata-eval38.5%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, -27\right)\right)\right), -3\right)\right) \]
        12. Simplified38.5%

          \[\leadsto \left(0.1111111111111111 - a \cdot a\right) \cdot \color{blue}{\left(a \cdot \left(9 + a \cdot -27\right) + -3\right)} \]
        13. Taylor expanded in a around inf

          \[\leadsto \color{blue}{27 \cdot {a}^{4}} \]
        14. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(27, \color{blue}{\left({a}^{4}\right)}\right) \]
          2. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(27, \left({a}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right) \]
          3. pow-sqrN/A

            \[\leadsto \mathsf{*.f64}\left(27, \left({a}^{2} \cdot \color{blue}{{a}^{2}}\right)\right) \]
          4. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(27, \left(\left(a \cdot a\right) \cdot {\color{blue}{a}}^{2}\right)\right) \]
          5. associate-*l*N/A

            \[\leadsto \mathsf{*.f64}\left(27, \left(a \cdot \color{blue}{\left(a \cdot {a}^{2}\right)}\right)\right) \]
          6. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(27, \left(a \cdot \left(a \cdot \left(a \cdot \color{blue}{a}\right)\right)\right)\right) \]
          7. cube-multN/A

            \[\leadsto \mathsf{*.f64}\left(27, \left(a \cdot {a}^{\color{blue}{3}}\right)\right) \]
          8. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \color{blue}{\left({a}^{3}\right)}\right)\right) \]
          9. cube-multN/A

            \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \left(a \cdot \color{blue}{\left(a \cdot a\right)}\right)\right)\right) \]
          10. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \left(a \cdot {a}^{\color{blue}{2}}\right)\right)\right) \]
          11. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{\left({a}^{2}\right)}\right)\right)\right) \]
          12. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(a \cdot \color{blue}{a}\right)\right)\right)\right) \]
          13. *-lowering-*.f6438.5%

            \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{a}\right)\right)\right)\right) \]
        15. Simplified38.5%

          \[\leadsto \color{blue}{27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)} \]
      15. Recombined 3 regimes into one program.
      16. Final simplification73.3%

        \[\leadsto \begin{array}{l} \mathbf{if}\;rand \leq -6.5 \cdot 10^{+110}:\\ \;\;\;\;0.1111111111111111 \cdot \left(-3 + a \cdot \left(9 + a \cdot -27\right)\right)\\ \mathbf{elif}\;rand \leq 1.8 \cdot 10^{+148}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)\\ \end{array} \]
      17. Add Preprocessing

      Alternative 17: 68.1% accurate, 8.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;rand \leq 1.35 \cdot 10^{+151}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)\\ \end{array} \end{array} \]
      (FPCore (a rand)
       :precision binary64
       (if (<= rand 1.35e+151)
         (+ a -0.3333333333333333)
         (* 27.0 (* a (* a (* a a))))))
      double code(double a, double rand) {
      	double tmp;
      	if (rand <= 1.35e+151) {
      		tmp = a + -0.3333333333333333;
      	} else {
      		tmp = 27.0 * (a * (a * (a * a)));
      	}
      	return tmp;
      }
      
      real(8) function code(a, rand)
          real(8), intent (in) :: a
          real(8), intent (in) :: rand
          real(8) :: tmp
          if (rand <= 1.35d+151) then
              tmp = a + (-0.3333333333333333d0)
          else
              tmp = 27.0d0 * (a * (a * (a * a)))
          end if
          code = tmp
      end function
      
      public static double code(double a, double rand) {
      	double tmp;
      	if (rand <= 1.35e+151) {
      		tmp = a + -0.3333333333333333;
      	} else {
      		tmp = 27.0 * (a * (a * (a * a)));
      	}
      	return tmp;
      }
      
      def code(a, rand):
      	tmp = 0
      	if rand <= 1.35e+151:
      		tmp = a + -0.3333333333333333
      	else:
      		tmp = 27.0 * (a * (a * (a * a)))
      	return tmp
      
      function code(a, rand)
      	tmp = 0.0
      	if (rand <= 1.35e+151)
      		tmp = Float64(a + -0.3333333333333333);
      	else
      		tmp = Float64(27.0 * Float64(a * Float64(a * Float64(a * a))));
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, rand)
      	tmp = 0.0;
      	if (rand <= 1.35e+151)
      		tmp = a + -0.3333333333333333;
      	else
      		tmp = 27.0 * (a * (a * (a * a)));
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, rand_] := If[LessEqual[rand, 1.35e+151], N[(a + -0.3333333333333333), $MachinePrecision], N[(27.0 * N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;rand \leq 1.35 \cdot 10^{+151}:\\
      \;\;\;\;a + -0.3333333333333333\\
      
      \mathbf{else}:\\
      \;\;\;\;27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if rand < 1.3500000000000001e151

        1. Initial program 99.8%

          \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
        2. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          4. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          6. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
          7. associate-*l/N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
          8. *-lft-identityN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
          9. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
          10. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
          11. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
          13. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          14. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          15. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          16. metadata-eval99.8%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
        3. Simplified99.8%

          \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in rand around 0

          \[\leadsto \color{blue}{a - \frac{1}{3}} \]
        6. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
          2. metadata-evalN/A

            \[\leadsto a + \frac{-1}{3} \]
          3. +-commutativeN/A

            \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
          4. +-lowering-+.f6471.9%

            \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
        7. Simplified71.9%

          \[\leadsto \color{blue}{-0.3333333333333333 + a} \]

        if 1.3500000000000001e151 < rand

        1. Initial program 99.5%

          \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
        2. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          4. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          6. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
          7. associate-*l/N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
          8. *-lft-identityN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
          9. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
          10. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
          11. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
          13. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          14. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          15. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          16. metadata-eval99.7%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
        3. Simplified99.7%

          \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in rand around 0

          \[\leadsto \color{blue}{a - \frac{1}{3}} \]
        6. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
          2. metadata-evalN/A

            \[\leadsto a + \frac{-1}{3} \]
          3. +-commutativeN/A

            \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
          4. +-lowering-+.f645.6%

            \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
        7. Simplified5.6%

          \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
        8. Step-by-step derivation
          1. flip-+N/A

            \[\leadsto \frac{\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a}{\color{blue}{\frac{-1}{3} - a}} \]
          2. div-invN/A

            \[\leadsto \left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right) \cdot \color{blue}{\frac{1}{\frac{-1}{3} - a}} \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right), \color{blue}{\left(\frac{1}{\frac{-1}{3} - a}\right)}\right) \]
          4. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3}\right), \left(a \cdot a\right)\right), \left(\frac{\color{blue}{1}}{\frac{-1}{3} - a}\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \left(a \cdot a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
          7. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{-1}{3} - a\right)}\right)\right) \]
          8. --lowering--.f6436.7%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{-1}{3}, \color{blue}{a}\right)\right)\right) \]
        9. Applied egg-rr36.7%

          \[\leadsto \color{blue}{\left(0.1111111111111111 - a \cdot a\right) \cdot \frac{1}{-0.3333333333333333 - a}} \]
        10. Taylor expanded in a around 0

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \color{blue}{\left(a \cdot \left(9 + -27 \cdot a\right) - 3\right)}\right) \]
        11. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(a \cdot \left(9 + -27 \cdot a\right) + \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
          2. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\left(a \cdot \left(9 + -27 \cdot a\right)\right), \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(9 + -27 \cdot a\right)\right), \left(\mathsf{neg}\left(\color{blue}{3}\right)\right)\right)\right) \]
          4. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \left(-27 \cdot a\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \left(a \cdot -27\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, -27\right)\right)\right), \left(\mathsf{neg}\left(3\right)\right)\right)\right) \]
          7. metadata-eval38.5%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{+.f64}\left(9, \mathsf{*.f64}\left(a, -27\right)\right)\right), -3\right)\right) \]
        12. Simplified38.5%

          \[\leadsto \left(0.1111111111111111 - a \cdot a\right) \cdot \color{blue}{\left(a \cdot \left(9 + a \cdot -27\right) + -3\right)} \]
        13. Taylor expanded in a around inf

          \[\leadsto \color{blue}{27 \cdot {a}^{4}} \]
        14. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(27, \color{blue}{\left({a}^{4}\right)}\right) \]
          2. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(27, \left({a}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right) \]
          3. pow-sqrN/A

            \[\leadsto \mathsf{*.f64}\left(27, \left({a}^{2} \cdot \color{blue}{{a}^{2}}\right)\right) \]
          4. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(27, \left(\left(a \cdot a\right) \cdot {\color{blue}{a}}^{2}\right)\right) \]
          5. associate-*l*N/A

            \[\leadsto \mathsf{*.f64}\left(27, \left(a \cdot \color{blue}{\left(a \cdot {a}^{2}\right)}\right)\right) \]
          6. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(27, \left(a \cdot \left(a \cdot \left(a \cdot \color{blue}{a}\right)\right)\right)\right) \]
          7. cube-multN/A

            \[\leadsto \mathsf{*.f64}\left(27, \left(a \cdot {a}^{\color{blue}{3}}\right)\right) \]
          8. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \color{blue}{\left({a}^{3}\right)}\right)\right) \]
          9. cube-multN/A

            \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \left(a \cdot \color{blue}{\left(a \cdot a\right)}\right)\right)\right) \]
          10. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \left(a \cdot {a}^{\color{blue}{2}}\right)\right)\right) \]
          11. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{\left({a}^{2}\right)}\right)\right)\right) \]
          12. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \left(a \cdot \color{blue}{a}\right)\right)\right)\right) \]
          13. *-lowering-*.f6438.5%

            \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{a}\right)\right)\right)\right) \]
        15. Simplified38.5%

          \[\leadsto \color{blue}{27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification68.0%

        \[\leadsto \begin{array}{l} \mathbf{if}\;rand \leq 1.35 \cdot 10^{+151}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 18: 67.0% accurate, 9.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;rand \leq 1.5 \cdot 10^{+151}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\left(0.1111111111111111 - a \cdot a\right) \cdot -3\\ \end{array} \end{array} \]
      (FPCore (a rand)
       :precision binary64
       (if (<= rand 1.5e+151)
         (+ a -0.3333333333333333)
         (* (- 0.1111111111111111 (* a a)) -3.0)))
      double code(double a, double rand) {
      	double tmp;
      	if (rand <= 1.5e+151) {
      		tmp = a + -0.3333333333333333;
      	} else {
      		tmp = (0.1111111111111111 - (a * a)) * -3.0;
      	}
      	return tmp;
      }
      
      real(8) function code(a, rand)
          real(8), intent (in) :: a
          real(8), intent (in) :: rand
          real(8) :: tmp
          if (rand <= 1.5d+151) then
              tmp = a + (-0.3333333333333333d0)
          else
              tmp = (0.1111111111111111d0 - (a * a)) * (-3.0d0)
          end if
          code = tmp
      end function
      
      public static double code(double a, double rand) {
      	double tmp;
      	if (rand <= 1.5e+151) {
      		tmp = a + -0.3333333333333333;
      	} else {
      		tmp = (0.1111111111111111 - (a * a)) * -3.0;
      	}
      	return tmp;
      }
      
      def code(a, rand):
      	tmp = 0
      	if rand <= 1.5e+151:
      		tmp = a + -0.3333333333333333
      	else:
      		tmp = (0.1111111111111111 - (a * a)) * -3.0
      	return tmp
      
      function code(a, rand)
      	tmp = 0.0
      	if (rand <= 1.5e+151)
      		tmp = Float64(a + -0.3333333333333333);
      	else
      		tmp = Float64(Float64(0.1111111111111111 - Float64(a * a)) * -3.0);
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, rand)
      	tmp = 0.0;
      	if (rand <= 1.5e+151)
      		tmp = a + -0.3333333333333333;
      	else
      		tmp = (0.1111111111111111 - (a * a)) * -3.0;
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, rand_] := If[LessEqual[rand, 1.5e+151], N[(a + -0.3333333333333333), $MachinePrecision], N[(N[(0.1111111111111111 - N[(a * a), $MachinePrecision]), $MachinePrecision] * -3.0), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;rand \leq 1.5 \cdot 10^{+151}:\\
      \;\;\;\;a + -0.3333333333333333\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(0.1111111111111111 - a \cdot a\right) \cdot -3\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if rand < 1.5e151

        1. Initial program 99.8%

          \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
        2. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          4. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          6. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
          7. associate-*l/N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
          8. *-lft-identityN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
          9. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
          10. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
          11. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
          13. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          14. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          15. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          16. metadata-eval99.8%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
        3. Simplified99.8%

          \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in rand around 0

          \[\leadsto \color{blue}{a - \frac{1}{3}} \]
        6. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
          2. metadata-evalN/A

            \[\leadsto a + \frac{-1}{3} \]
          3. +-commutativeN/A

            \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
          4. +-lowering-+.f6471.9%

            \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
        7. Simplified71.9%

          \[\leadsto \color{blue}{-0.3333333333333333 + a} \]

        if 1.5e151 < rand

        1. Initial program 99.5%

          \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
        2. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          4. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          6. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
          7. associate-*l/N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
          8. *-lft-identityN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
          9. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
          10. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
          11. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
          13. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          14. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          15. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          16. metadata-eval99.7%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
        3. Simplified99.7%

          \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in rand around 0

          \[\leadsto \color{blue}{a - \frac{1}{3}} \]
        6. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
          2. metadata-evalN/A

            \[\leadsto a + \frac{-1}{3} \]
          3. +-commutativeN/A

            \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
          4. +-lowering-+.f645.6%

            \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
        7. Simplified5.6%

          \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
        8. Step-by-step derivation
          1. flip-+N/A

            \[\leadsto \frac{\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a}{\color{blue}{\frac{-1}{3} - a}} \]
          2. div-invN/A

            \[\leadsto \left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right) \cdot \color{blue}{\frac{1}{\frac{-1}{3} - a}} \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3} - a \cdot a\right), \color{blue}{\left(\frac{1}{\frac{-1}{3} - a}\right)}\right) \]
          4. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{-1}{3} \cdot \frac{-1}{3}\right), \left(a \cdot a\right)\right), \left(\frac{\color{blue}{1}}{\frac{-1}{3} - a}\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \left(a \cdot a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \left(\frac{1}{\frac{-1}{3} - a}\right)\right) \]
          7. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{-1}{3} - a\right)}\right)\right) \]
          8. --lowering--.f6436.7%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{-1}{3}, \color{blue}{a}\right)\right)\right) \]
        9. Applied egg-rr36.7%

          \[\leadsto \color{blue}{\left(0.1111111111111111 - a \cdot a\right) \cdot \frac{1}{-0.3333333333333333 - a}} \]
        10. Taylor expanded in a around 0

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{9}, \mathsf{*.f64}\left(a, a\right)\right), \color{blue}{-3}\right) \]
        11. Step-by-step derivation
          1. Simplified37.4%

            \[\leadsto \left(0.1111111111111111 - a \cdot a\right) \cdot \color{blue}{-3} \]
        12. Recombined 2 regimes into one program.
        13. Final simplification67.8%

          \[\leadsto \begin{array}{l} \mathbf{if}\;rand \leq 1.5 \cdot 10^{+151}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\left(0.1111111111111111 - a \cdot a\right) \cdot -3\\ \end{array} \]
        14. Add Preprocessing

        Alternative 19: 62.9% accurate, 39.7× speedup?

        \[\begin{array}{l} \\ a + -0.3333333333333333 \end{array} \]
        (FPCore (a rand) :precision binary64 (+ a -0.3333333333333333))
        double code(double a, double rand) {
        	return a + -0.3333333333333333;
        }
        
        real(8) function code(a, rand)
            real(8), intent (in) :: a
            real(8), intent (in) :: rand
            code = a + (-0.3333333333333333d0)
        end function
        
        public static double code(double a, double rand) {
        	return a + -0.3333333333333333;
        }
        
        def code(a, rand):
        	return a + -0.3333333333333333
        
        function code(a, rand)
        	return Float64(a + -0.3333333333333333)
        end
        
        function tmp = code(a, rand)
        	tmp = a + -0.3333333333333333;
        end
        
        code[a_, rand_] := N[(a + -0.3333333333333333), $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        a + -0.3333333333333333
        \end{array}
        
        Derivation
        1. Initial program 99.8%

          \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
        2. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          4. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          6. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
          7. associate-*l/N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
          8. *-lft-identityN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
          9. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
          10. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
          11. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
          13. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          14. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          15. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          16. metadata-eval99.8%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
        3. Simplified99.8%

          \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in rand around 0

          \[\leadsto \color{blue}{a - \frac{1}{3}} \]
        6. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
          2. metadata-evalN/A

            \[\leadsto a + \frac{-1}{3} \]
          3. +-commutativeN/A

            \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
          4. +-lowering-+.f6464.1%

            \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
        7. Simplified64.1%

          \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
        8. Final simplification64.1%

          \[\leadsto a + -0.3333333333333333 \]
        9. Add Preprocessing

        Alternative 20: 61.8% accurate, 119.0× speedup?

        \[\begin{array}{l} \\ a \end{array} \]
        (FPCore (a rand) :precision binary64 a)
        double code(double a, double rand) {
        	return a;
        }
        
        real(8) function code(a, rand)
            real(8), intent (in) :: a
            real(8), intent (in) :: rand
            code = a
        end function
        
        public static double code(double a, double rand) {
        	return a;
        }
        
        def code(a, rand):
        	return a
        
        function code(a, rand)
        	return a
        end
        
        function tmp = code(a, rand)
        	tmp = a;
        end
        
        code[a_, rand_] := a
        
        \begin{array}{l}
        
        \\
        a
        \end{array}
        
        Derivation
        1. Initial program 99.8%

          \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
        2. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          4. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
          6. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
          7. associate-*l/N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
          8. *-lft-identityN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
          9. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
          10. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
          11. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
          13. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          14. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          15. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
          16. metadata-eval99.8%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
        3. Simplified99.8%

          \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in rand around 0

          \[\leadsto \color{blue}{a - \frac{1}{3}} \]
        6. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
          2. metadata-evalN/A

            \[\leadsto a + \frac{-1}{3} \]
          3. +-commutativeN/A

            \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
          4. +-lowering-+.f6464.1%

            \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
        7. Simplified64.1%

          \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
        8. Taylor expanded in a around inf

          \[\leadsto \color{blue}{a} \]
        9. Step-by-step derivation
          1. Simplified62.5%

            \[\leadsto \color{blue}{a} \]
          2. Add Preprocessing

          Alternative 21: 1.5% accurate, 119.0× speedup?

          \[\begin{array}{l} \\ -0.3333333333333333 \end{array} \]
          (FPCore (a rand) :precision binary64 -0.3333333333333333)
          double code(double a, double rand) {
          	return -0.3333333333333333;
          }
          
          real(8) function code(a, rand)
              real(8), intent (in) :: a
              real(8), intent (in) :: rand
              code = -0.3333333333333333d0
          end function
          
          public static double code(double a, double rand) {
          	return -0.3333333333333333;
          }
          
          def code(a, rand):
          	return -0.3333333333333333
          
          function code(a, rand)
          	return -0.3333333333333333
          end
          
          function tmp = code(a, rand)
          	tmp = -0.3333333333333333;
          end
          
          code[a_, rand_] := -0.3333333333333333
          
          \begin{array}{l}
          
          \\
          -0.3333333333333333
          \end{array}
          
          Derivation
          1. Initial program 99.8%

            \[\left(a - \frac{1}{3}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \]
          2. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right) \]
            2. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
            3. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(\color{blue}{1} + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
            4. metadata-evalN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
            5. metadata-evalN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) \]
            6. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)}\right)\right) \]
            7. associate-*l/N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{1 \cdot rand}{\color{blue}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
            8. *-lft-identityN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \left(\frac{rand}{\sqrt{\color{blue}{9 \cdot \left(a - \frac{1}{3}\right)}}}\right)\right)\right) \]
            9. /-lowering-/.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \color{blue}{\left(\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}\right)}\right)\right)\right) \]
            10. sqrt-lowering-sqrt.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(9 \cdot \left(a - \frac{1}{3}\right)\right)\right)\right)\right)\right) \]
            11. *-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\left(\left(a - \frac{1}{3}\right) \cdot 9\right)\right)\right)\right)\right) \]
            12. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a - \frac{1}{3}\right), 9\right)\right)\right)\right)\right) \]
            13. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(a + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
            14. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
            15. metadata-evalN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right), 9\right)\right)\right)\right)\right) \]
            16. metadata-eval99.8%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(rand, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), 9\right)\right)\right)\right)\right) \]
          3. Simplified99.8%

            \[\leadsto \color{blue}{\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{\left(a + -0.3333333333333333\right) \cdot 9}}\right)} \]
          4. Add Preprocessing
          5. Taylor expanded in rand around 0

            \[\leadsto \color{blue}{a - \frac{1}{3}} \]
          6. Step-by-step derivation
            1. sub-negN/A

              \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)} \]
            2. metadata-evalN/A

              \[\leadsto a + \frac{-1}{3} \]
            3. +-commutativeN/A

              \[\leadsto \frac{-1}{3} + \color{blue}{a} \]
            4. +-lowering-+.f6464.1%

              \[\leadsto \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{a}\right) \]
          7. Simplified64.1%

            \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
          8. Taylor expanded in a around 0

            \[\leadsto \color{blue}{\frac{-1}{3}} \]
          9. Step-by-step derivation
            1. Simplified1.5%

              \[\leadsto \color{blue}{-0.3333333333333333} \]
            2. Add Preprocessing

            Reproduce

            ?
            herbie shell --seed 2024155 
            (FPCore (a rand)
              :name "Octave 3.8, oct_fill_randg"
              :precision binary64
              (* (- a (/ 1.0 3.0)) (+ 1.0 (* (/ 1.0 (sqrt (* 9.0 (- a (/ 1.0 3.0))))) rand))))