Octave 3.8, oct_fill_randg

Percentage Accurate: 99.7% → 99.9%
Time: 11.7s
Alternatives: 18
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 18 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.9% accurate, 1.1× speedup?

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

\\
\left(a + \frac{\sqrt{a + -0.3333333333333333}}{\frac{3}{rand}}\right) - 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. Step-by-step derivation
    1. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand + 1\right) \cdot \left(a - \frac{1}{3}\right) \]
    12. distribute-lft1-inN/A

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

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

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

    \[\leadsto \color{blue}{\left(a + \frac{\sqrt{a + -0.3333333333333333}}{\frac{3}{rand}}\right) - 0.3333333333333333} \]
  7. Add Preprocessing

Alternative 2: 93.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{a + -0.3333333333333333} \cdot \frac{rand}{3}\\ \mathbf{if}\;rand \leq -8.6 \cdot 10^{+69}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;rand \leq 3 \cdot 10^{+80}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a rand)
 :precision binary64
 (let* ((t_0 (* (sqrt (+ a -0.3333333333333333)) (/ rand 3.0))))
   (if (<= rand -8.6e+69)
     t_0
     (if (<= rand 3e+80) (+ a -0.3333333333333333) t_0))))
double code(double a, double rand) {
	double t_0 = sqrt((a + -0.3333333333333333)) * (rand / 3.0);
	double tmp;
	if (rand <= -8.6e+69) {
		tmp = t_0;
	} else if (rand <= 3e+80) {
		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))) * (rand / 3.0d0)
    if (rand <= (-8.6d+69)) then
        tmp = t_0
    else if (rand <= 3d+80) 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)) * (rand / 3.0);
	double tmp;
	if (rand <= -8.6e+69) {
		tmp = t_0;
	} else if (rand <= 3e+80) {
		tmp = a + -0.3333333333333333;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(a, rand):
	t_0 = math.sqrt((a + -0.3333333333333333)) * (rand / 3.0)
	tmp = 0
	if rand <= -8.6e+69:
		tmp = t_0
	elif rand <= 3e+80:
		tmp = a + -0.3333333333333333
	else:
		tmp = t_0
	return tmp
function code(a, rand)
	t_0 = Float64(sqrt(Float64(a + -0.3333333333333333)) * Float64(rand / 3.0))
	tmp = 0.0
	if (rand <= -8.6e+69)
		tmp = t_0;
	elseif (rand <= 3e+80)
		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)) * (rand / 3.0);
	tmp = 0.0;
	if (rand <= -8.6e+69)
		tmp = t_0;
	elseif (rand <= 3e+80)
		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[(rand / 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -8.6e+69], t$95$0, If[LessEqual[rand, 3e+80], N[(a + -0.3333333333333333), $MachinePrecision], t$95$0]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if rand < -8.59999999999999986e69 or 2.99999999999999987e80 < rand

    1. Initial program 99.6%

      \[\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 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-*.f6492.4%

        \[\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. Simplified92.4%

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

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

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

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

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

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

    if -8.59999999999999986e69 < rand < 2.99999999999999987e80

    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-+.f6495.1%

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

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

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

Alternative 3: 93.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{a + -0.3333333333333333} \cdot \left(rand \cdot 0.3333333333333333\right)\\ \mathbf{if}\;rand \leq -1.5 \cdot 10^{+70}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;rand \leq 2 \cdot 10^{+78}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a rand)
 :precision binary64
 (let* ((t_0 (* (sqrt (+ a -0.3333333333333333)) (* rand 0.3333333333333333))))
   (if (<= rand -1.5e+70)
     t_0
     (if (<= rand 2e+78) (+ a -0.3333333333333333) t_0))))
double code(double a, double rand) {
	double t_0 = sqrt((a + -0.3333333333333333)) * (rand * 0.3333333333333333);
	double tmp;
	if (rand <= -1.5e+70) {
		tmp = t_0;
	} else if (rand <= 2e+78) {
		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))) * (rand * 0.3333333333333333d0)
    if (rand <= (-1.5d+70)) then
        tmp = t_0
    else if (rand <= 2d+78) 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)) * (rand * 0.3333333333333333);
	double tmp;
	if (rand <= -1.5e+70) {
		tmp = t_0;
	} else if (rand <= 2e+78) {
		tmp = a + -0.3333333333333333;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(a, rand):
	t_0 = math.sqrt((a + -0.3333333333333333)) * (rand * 0.3333333333333333)
	tmp = 0
	if rand <= -1.5e+70:
		tmp = t_0
	elif rand <= 2e+78:
		tmp = a + -0.3333333333333333
	else:
		tmp = t_0
	return tmp
function code(a, rand)
	t_0 = Float64(sqrt(Float64(a + -0.3333333333333333)) * Float64(rand * 0.3333333333333333))
	tmp = 0.0
	if (rand <= -1.5e+70)
		tmp = t_0;
	elseif (rand <= 2e+78)
		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)) * (rand * 0.3333333333333333);
	tmp = 0.0;
	if (rand <= -1.5e+70)
		tmp = t_0;
	elseif (rand <= 2e+78)
		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[(rand * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -1.5e+70], t$95$0, If[LessEqual[rand, 2e+78], N[(a + -0.3333333333333333), $MachinePrecision], t$95$0]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if rand < -1.49999999999999988e70 or 2.00000000000000002e78 < rand

    1. Initial program 99.6%

      \[\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 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-*.f6492.4%

        \[\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. Simplified92.4%

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

    if -1.49999999999999988e70 < rand < 2.00000000000000002e78

    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-+.f6495.1%

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

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

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

Alternative 4: 92.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;rand \leq -1.9 \cdot 10^{+70}:\\ \;\;\;\;\frac{\sqrt{a}}{\frac{3}{rand}}\\ \mathbf{elif}\;rand \leq 1.02 \cdot 10^{+76}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\frac{rand \cdot \sqrt{a}}{3}\\ \end{array} \end{array} \]
(FPCore (a rand)
 :precision binary64
 (if (<= rand -1.9e+70)
   (/ (sqrt a) (/ 3.0 rand))
   (if (<= rand 1.02e+76)
     (+ a -0.3333333333333333)
     (/ (* rand (sqrt a)) 3.0))))
double code(double a, double rand) {
	double tmp;
	if (rand <= -1.9e+70) {
		tmp = sqrt(a) / (3.0 / rand);
	} else if (rand <= 1.02e+76) {
		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.9d+70)) then
        tmp = sqrt(a) / (3.0d0 / rand)
    else if (rand <= 1.02d+76) 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.9e+70) {
		tmp = Math.sqrt(a) / (3.0 / rand);
	} else if (rand <= 1.02e+76) {
		tmp = a + -0.3333333333333333;
	} else {
		tmp = (rand * Math.sqrt(a)) / 3.0;
	}
	return tmp;
}
def code(a, rand):
	tmp = 0
	if rand <= -1.9e+70:
		tmp = math.sqrt(a) / (3.0 / rand)
	elif rand <= 1.02e+76:
		tmp = a + -0.3333333333333333
	else:
		tmp = (rand * math.sqrt(a)) / 3.0
	return tmp
function code(a, rand)
	tmp = 0.0
	if (rand <= -1.9e+70)
		tmp = Float64(sqrt(a) / Float64(3.0 / rand));
	elseif (rand <= 1.02e+76)
		tmp = Float64(a + -0.3333333333333333);
	else
		tmp = Float64(Float64(rand * sqrt(a)) / 3.0);
	end
	return tmp
end
function tmp_2 = code(a, rand)
	tmp = 0.0;
	if (rand <= -1.9e+70)
		tmp = sqrt(a) / (3.0 / rand);
	elseif (rand <= 1.02e+76)
		tmp = a + -0.3333333333333333;
	else
		tmp = (rand * sqrt(a)) / 3.0;
	end
	tmp_2 = tmp;
end
code[a_, rand_] := If[LessEqual[rand, -1.9e+70], N[(N[Sqrt[a], $MachinePrecision] / N[(3.0 / rand), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 1.02e+76], N[(a + -0.3333333333333333), $MachinePrecision], N[(N[(rand * N[Sqrt[a], $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 99.6%

      \[\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 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.7%

        \[\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.7%

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

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

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

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

          \[\leadsto \sqrt{a} \cdot \frac{-1}{\color{blue}{\frac{-3}{rand}}} \]
        3. frac-2negN/A

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(a\right), \left(\mathsf{neg}\left(\color{blue}{\frac{-3}{rand}}\right)\right)\right) \]
        8. distribute-neg-fracN/A

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(a\right), \mathsf{/.f64}\left(\left(\mathsf{neg}\left(-3\right)\right), \color{blue}{rand}\right)\right) \]
        10. metadata-eval88.7%

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

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

      if -1.8999999999999999e70 < rand < 1.02000000000000007e76

      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-+.f6495.1%

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

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

      if 1.02000000000000007e76 < rand

      1. Initial program 99.7%

        \[\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 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-*.f6497.1%

          \[\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. Simplified97.1%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(rand, \mathsf{sqrt.f64}\left(a\right)\right), \left(\mathsf{neg}\left(-3\right)\right)\right) \]
          10. metadata-eval96.3%

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

          \[\leadsto \color{blue}{\frac{rand \cdot \sqrt{a}}{3}} \]
      10. Recombined 3 regimes into one program.
      11. Final simplification93.6%

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

      Alternative 5: 92.3% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sqrt{a}}{\frac{3}{rand}}\\ \mathbf{if}\;rand \leq -2.35 \cdot 10^{+70}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;rand \leq 1.05 \cdot 10^{+78}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (a rand)
       :precision binary64
       (let* ((t_0 (/ (sqrt a) (/ 3.0 rand))))
         (if (<= rand -2.35e+70)
           t_0
           (if (<= rand 1.05e+78) (+ a -0.3333333333333333) t_0))))
      double code(double a, double rand) {
      	double t_0 = sqrt(a) / (3.0 / rand);
      	double tmp;
      	if (rand <= -2.35e+70) {
      		tmp = t_0;
      	} else if (rand <= 1.05e+78) {
      		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) / (3.0d0 / rand)
          if (rand <= (-2.35d+70)) then
              tmp = t_0
          else if (rand <= 1.05d+78) 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) / (3.0 / rand);
      	double tmp;
      	if (rand <= -2.35e+70) {
      		tmp = t_0;
      	} else if (rand <= 1.05e+78) {
      		tmp = a + -0.3333333333333333;
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(a, rand):
      	t_0 = math.sqrt(a) / (3.0 / rand)
      	tmp = 0
      	if rand <= -2.35e+70:
      		tmp = t_0
      	elif rand <= 1.05e+78:
      		tmp = a + -0.3333333333333333
      	else:
      		tmp = t_0
      	return tmp
      
      function code(a, rand)
      	t_0 = Float64(sqrt(a) / Float64(3.0 / rand))
      	tmp = 0.0
      	if (rand <= -2.35e+70)
      		tmp = t_0;
      	elseif (rand <= 1.05e+78)
      		tmp = Float64(a + -0.3333333333333333);
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, rand)
      	t_0 = sqrt(a) / (3.0 / rand);
      	tmp = 0.0;
      	if (rand <= -2.35e+70)
      		tmp = t_0;
      	elseif (rand <= 1.05e+78)
      		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[(3.0 / rand), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -2.35e+70], t$95$0, If[LessEqual[rand, 1.05e+78], N[(a + -0.3333333333333333), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{\sqrt{a}}{\frac{3}{rand}}\\
      \mathbf{if}\;rand \leq -2.35 \cdot 10^{+70}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;rand \leq 1.05 \cdot 10^{+78}:\\
      \;\;\;\;a + -0.3333333333333333\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if rand < -2.3499999999999999e70 or 1.05e78 < rand

        1. Initial program 99.6%

          \[\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 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-*.f6492.4%

            \[\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. Simplified92.4%

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

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

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

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

              \[\leadsto \sqrt{a} \cdot \frac{-1}{\color{blue}{\frac{-3}{rand}}} \]
            3. frac-2negN/A

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(a\right), \left(\mathsf{neg}\left(\color{blue}{\frac{-3}{rand}}\right)\right)\right) \]
            8. distribute-neg-fracN/A

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(a\right), \mathsf{/.f64}\left(\left(\mathsf{neg}\left(-3\right)\right), \color{blue}{rand}\right)\right) \]
            10. metadata-eval91.5%

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

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

          if -2.3499999999999999e70 < rand < 1.05e78

          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-+.f6495.1%

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

            \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
        10. Recombined 2 regimes into one program.
        11. Final simplification93.6%

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

        Alternative 6: 92.2% accurate, 1.0× speedup?

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

          1. Initial program 99.6%

            \[\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 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.7%

              \[\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.7%

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\sqrt{a}}{3} \cdot rand \]
              3. clear-numN/A

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

                \[\leadsto \frac{1}{\color{blue}{\frac{\frac{3}{\sqrt{a}}}{rand}}} \]
              5. clear-numN/A

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

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

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

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

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

            if -2.7999999999999999e70 < rand < 6.5000000000000003e82

            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-+.f6495.1%

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

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

            if 6.5000000000000003e82 < rand

            1. Initial program 99.7%

              \[\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 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-*.f6497.1%

                \[\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. Simplified97.1%

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

              \[\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.f6496.2%

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

              \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)} \]
          10. Recombined 3 regimes into one program.
          11. Final simplification93.6%

            \[\leadsto \begin{array}{l} \mathbf{if}\;rand \leq -2.8 \cdot 10^{+70}:\\ \;\;\;\;\frac{rand}{\frac{3}{\sqrt{a}}}\\ \mathbf{elif}\;rand \leq 6.5 \cdot 10^{+82}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)\\ \end{array} \]
          12. Add Preprocessing

          Alternative 7: 92.2% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;rand \leq -1.7 \cdot 10^{+70}:\\ \;\;\;\;rand \cdot \left(0.3333333333333333 \cdot \sqrt{a}\right)\\ \mathbf{elif}\;rand \leq 3.2 \cdot 10^{+81}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)\\ \end{array} \end{array} \]
          (FPCore (a rand)
           :precision binary64
           (if (<= rand -1.7e+70)
             (* rand (* 0.3333333333333333 (sqrt a)))
             (if (<= rand 3.2e+81)
               (+ a -0.3333333333333333)
               (* 0.3333333333333333 (* rand (sqrt a))))))
          double code(double a, double rand) {
          	double tmp;
          	if (rand <= -1.7e+70) {
          		tmp = rand * (0.3333333333333333 * sqrt(a));
          	} else if (rand <= 3.2e+81) {
          		tmp = a + -0.3333333333333333;
          	} else {
          		tmp = 0.3333333333333333 * (rand * sqrt(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.7d+70)) then
                  tmp = rand * (0.3333333333333333d0 * sqrt(a))
              else if (rand <= 3.2d+81) then
                  tmp = a + (-0.3333333333333333d0)
              else
                  tmp = 0.3333333333333333d0 * (rand * sqrt(a))
              end if
              code = tmp
          end function
          
          public static double code(double a, double rand) {
          	double tmp;
          	if (rand <= -1.7e+70) {
          		tmp = rand * (0.3333333333333333 * Math.sqrt(a));
          	} else if (rand <= 3.2e+81) {
          		tmp = a + -0.3333333333333333;
          	} else {
          		tmp = 0.3333333333333333 * (rand * Math.sqrt(a));
          	}
          	return tmp;
          }
          
          def code(a, rand):
          	tmp = 0
          	if rand <= -1.7e+70:
          		tmp = rand * (0.3333333333333333 * math.sqrt(a))
          	elif rand <= 3.2e+81:
          		tmp = a + -0.3333333333333333
          	else:
          		tmp = 0.3333333333333333 * (rand * math.sqrt(a))
          	return tmp
          
          function code(a, rand)
          	tmp = 0.0
          	if (rand <= -1.7e+70)
          		tmp = Float64(rand * Float64(0.3333333333333333 * sqrt(a)));
          	elseif (rand <= 3.2e+81)
          		tmp = Float64(a + -0.3333333333333333);
          	else
          		tmp = Float64(0.3333333333333333 * Float64(rand * sqrt(a)));
          	end
          	return tmp
          end
          
          function tmp_2 = code(a, rand)
          	tmp = 0.0;
          	if (rand <= -1.7e+70)
          		tmp = rand * (0.3333333333333333 * sqrt(a));
          	elseif (rand <= 3.2e+81)
          		tmp = a + -0.3333333333333333;
          	else
          		tmp = 0.3333333333333333 * (rand * sqrt(a));
          	end
          	tmp_2 = tmp;
          end
          
          code[a_, rand_] := If[LessEqual[rand, -1.7e+70], N[(rand * N[(0.3333333333333333 * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 3.2e+81], N[(a + -0.3333333333333333), $MachinePrecision], N[(0.3333333333333333 * N[(rand * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;rand \leq -1.7 \cdot 10^{+70}:\\
          \;\;\;\;rand \cdot \left(0.3333333333333333 \cdot \sqrt{a}\right)\\
          
          \mathbf{elif}\;rand \leq 3.2 \cdot 10^{+81}:\\
          \;\;\;\;a + -0.3333333333333333\\
          
          \mathbf{else}:\\
          \;\;\;\;0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if rand < -1.7e70

            1. Initial program 99.6%

              \[\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 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.7%

                \[\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.7%

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

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

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

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

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

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

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

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

              if -1.7e70 < rand < 3.2e81

              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-+.f6495.1%

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

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

              if 3.2e81 < rand

              1. Initial program 99.7%

                \[\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 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-*.f6497.1%

                  \[\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. Simplified97.1%

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

                \[\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.f6496.2%

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

                \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)} \]
            10. Recombined 3 regimes into one program.
            11. Final simplification93.5%

              \[\leadsto \begin{array}{l} \mathbf{if}\;rand \leq -1.7 \cdot 10^{+70}:\\ \;\;\;\;rand \cdot \left(0.3333333333333333 \cdot \sqrt{a}\right)\\ \mathbf{elif}\;rand \leq 3.2 \cdot 10^{+81}:\\ \;\;\;\;a + -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)\\ \end{array} \]
            12. Add Preprocessing

            Alternative 8: 92.1% 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 -3.2 \cdot 10^{+69}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;rand \leq 1.26 \cdot 10^{+76}:\\ \;\;\;\;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 -3.2e+69)
                 t_0
                 (if (<= rand 1.26e+76) (+ a -0.3333333333333333) t_0))))
            double code(double a, double rand) {
            	double t_0 = 0.3333333333333333 * (rand * sqrt(a));
            	double tmp;
            	if (rand <= -3.2e+69) {
            		tmp = t_0;
            	} else if (rand <= 1.26e+76) {
            		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 <= (-3.2d+69)) then
                    tmp = t_0
                else if (rand <= 1.26d+76) 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 <= -3.2e+69) {
            		tmp = t_0;
            	} else if (rand <= 1.26e+76) {
            		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 <= -3.2e+69:
            		tmp = t_0
            	elif rand <= 1.26e+76:
            		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 <= -3.2e+69)
            		tmp = t_0;
            	elseif (rand <= 1.26e+76)
            		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 <= -3.2e+69)
            		tmp = t_0;
            	elseif (rand <= 1.26e+76)
            		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, -3.2e+69], t$95$0, If[LessEqual[rand, 1.26e+76], 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 -3.2 \cdot 10^{+69}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;rand \leq 1.26 \cdot 10^{+76}:\\
            \;\;\;\;a + -0.3333333333333333\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if rand < -3.19999999999999985e69 or 1.26000000000000007e76 < rand

              1. Initial program 99.6%

                \[\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 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-*.f6492.4%

                  \[\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. Simplified92.4%

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

                \[\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.3%

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

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

              if -3.19999999999999985e69 < rand < 1.26000000000000007e76

              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-+.f6495.1%

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

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

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

            Alternative 9: 99.9% accurate, 1.1× speedup?

            \[\begin{array}{l} \\ \left(a + -0.3333333333333333\right) - \frac{rand}{-3} \cdot \sqrt{a + -0.3333333333333333} \end{array} \]
            (FPCore (a rand)
             :precision binary64
             (-
              (+ a -0.3333333333333333)
              (* (/ rand -3.0) (sqrt (+ a -0.3333333333333333)))))
            double code(double a, double rand) {
            	return (a + -0.3333333333333333) - ((rand / -3.0) * sqrt((a + -0.3333333333333333)));
            }
            
            real(8) function code(a, rand)
                real(8), intent (in) :: a
                real(8), intent (in) :: rand
                code = (a + (-0.3333333333333333d0)) - ((rand / (-3.0d0)) * sqrt((a + (-0.3333333333333333d0))))
            end function
            
            public static double code(double a, double rand) {
            	return (a + -0.3333333333333333) - ((rand / -3.0) * Math.sqrt((a + -0.3333333333333333)));
            }
            
            def code(a, rand):
            	return (a + -0.3333333333333333) - ((rand / -3.0) * math.sqrt((a + -0.3333333333333333)))
            
            function code(a, rand)
            	return Float64(Float64(a + -0.3333333333333333) - Float64(Float64(rand / -3.0) * sqrt(Float64(a + -0.3333333333333333))))
            end
            
            function tmp = code(a, rand)
            	tmp = (a + -0.3333333333333333) - ((rand / -3.0) * sqrt((a + -0.3333333333333333)));
            end
            
            code[a_, rand_] := N[(N[(a + -0.3333333333333333), $MachinePrecision] - N[(N[(rand / -3.0), $MachinePrecision] * N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            \left(a + -0.3333333333333333\right) - \frac{rand}{-3} \cdot \sqrt{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. Applied egg-rr99.8%

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

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

            Alternative 10: 98.7% accurate, 1.1× speedup?

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

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

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

              Alternative 11: 98.7% accurate, 1.1× speedup?

              \[\begin{array}{l} \\ a - \frac{\frac{rand}{{\left(a + -0.3333333333333333\right)}^{-0.5}}}{-3} \end{array} \]
              (FPCore (a rand)
               :precision binary64
               (- a (/ (/ rand (pow (+ a -0.3333333333333333) -0.5)) -3.0)))
              double code(double a, double rand) {
              	return a - ((rand / pow((a + -0.3333333333333333), -0.5)) / -3.0);
              }
              
              real(8) function code(a, rand)
                  real(8), intent (in) :: a
                  real(8), intent (in) :: rand
                  code = a - ((rand / ((a + (-0.3333333333333333d0)) ** (-0.5d0))) / (-3.0d0))
              end function
              
              public static double code(double a, double rand) {
              	return a - ((rand / Math.pow((a + -0.3333333333333333), -0.5)) / -3.0);
              }
              
              def code(a, rand):
              	return a - ((rand / math.pow((a + -0.3333333333333333), -0.5)) / -3.0)
              
              function code(a, rand)
              	return Float64(a - Float64(Float64(rand / (Float64(a + -0.3333333333333333) ^ -0.5)) / -3.0))
              end
              
              function tmp = code(a, rand)
              	tmp = a - ((rand / ((a + -0.3333333333333333) ^ -0.5)) / -3.0);
              end
              
              code[a_, rand_] := N[(a - N[(N[(rand / N[Power[N[(a + -0.3333333333333333), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision]
              
              \begin{array}{l}
              
              \\
              a - \frac{\frac{rand}{{\left(a + -0.3333333333333333\right)}^{-0.5}}}{-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. Applied egg-rr99.8%

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

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

                  \[\leadsto \color{blue}{a} - \sqrt{a + -0.3333333333333333} \cdot \frac{rand}{-3} \]
                2. Step-by-step derivation
                  1. pow1/2N/A

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

                    \[\leadsto \mathsf{\_.f64}\left(a, \left({\left(a + \frac{-1}{3}\right)}^{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)} \cdot \frac{rand}{-3}\right)\right) \]
                  3. pow-flipN/A

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

                    \[\leadsto \mathsf{\_.f64}\left(a, \left(\frac{1}{\color{blue}{\frac{{\left(a + \frac{-1}{3}\right)}^{\frac{-1}{2}}}{\frac{rand}{-3}}}}\right)\right) \]
                  5. clear-numN/A

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

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

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

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

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

                    \[\leadsto \mathsf{\_.f64}\left(a, \mathsf{/.f64}\left(\mathsf{/.f64}\left(rand, \mathsf{pow.f64}\left(\left(a + \frac{-1}{3}\right), \frac{-1}{2}\right)\right), -3\right)\right) \]
                  11. +-lowering-+.f6498.7%

                    \[\leadsto \mathsf{\_.f64}\left(a, \mathsf{/.f64}\left(\mathsf{/.f64}\left(rand, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(a, \frac{-1}{3}\right), \frac{-1}{2}\right)\right), -3\right)\right) \]
                3. Applied egg-rr98.7%

                  \[\leadsto a - \color{blue}{\frac{\frac{rand}{{\left(a + -0.3333333333333333\right)}^{-0.5}}}{-3}} \]
                4. Add Preprocessing

                Alternative 12: 98.8% accurate, 1.1× speedup?

                \[\begin{array}{l} \\ a - \frac{rand}{-3} \cdot \sqrt{a + -0.3333333333333333} \end{array} \]
                (FPCore (a rand)
                 :precision binary64
                 (- a (* (/ rand -3.0) (sqrt (+ a -0.3333333333333333)))))
                double code(double a, double rand) {
                	return a - ((rand / -3.0) * sqrt((a + -0.3333333333333333)));
                }
                
                real(8) function code(a, rand)
                    real(8), intent (in) :: a
                    real(8), intent (in) :: rand
                    code = a - ((rand / (-3.0d0)) * sqrt((a + (-0.3333333333333333d0))))
                end function
                
                public static double code(double a, double rand) {
                	return a - ((rand / -3.0) * Math.sqrt((a + -0.3333333333333333)));
                }
                
                def code(a, rand):
                	return a - ((rand / -3.0) * math.sqrt((a + -0.3333333333333333)))
                
                function code(a, rand)
                	return Float64(a - Float64(Float64(rand / -3.0) * sqrt(Float64(a + -0.3333333333333333))))
                end
                
                function tmp = code(a, rand)
                	tmp = a - ((rand / -3.0) * sqrt((a + -0.3333333333333333)));
                end
                
                code[a_, rand_] := N[(a - N[(N[(rand / -3.0), $MachinePrecision] * N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                a - \frac{rand}{-3} \cdot \sqrt{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. Applied egg-rr99.8%

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

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

                    \[\leadsto \color{blue}{a} - \sqrt{a + -0.3333333333333333} \cdot \frac{rand}{-3} \]
                  2. Final simplification98.7%

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

                  Alternative 13: 97.8% accurate, 1.1× speedup?

                  \[\begin{array}{l} \\ a - \frac{\sqrt{a}}{\frac{-3}{rand}} \end{array} \]
                  (FPCore (a rand) :precision binary64 (- a (/ (sqrt a) (/ -3.0 rand))))
                  double code(double a, double rand) {
                  	return a - (sqrt(a) / (-3.0 / rand));
                  }
                  
                  real(8) function code(a, rand)
                      real(8), intent (in) :: a
                      real(8), intent (in) :: rand
                      code = a - (sqrt(a) / ((-3.0d0) / rand))
                  end function
                  
                  public static double code(double a, double rand) {
                  	return a - (Math.sqrt(a) / (-3.0 / rand));
                  }
                  
                  def code(a, rand):
                  	return a - (math.sqrt(a) / (-3.0 / rand))
                  
                  function code(a, rand)
                  	return Float64(a - Float64(sqrt(a) / Float64(-3.0 / rand)))
                  end
                  
                  function tmp = code(a, rand)
                  	tmp = a - (sqrt(a) / (-3.0 / rand));
                  end
                  
                  code[a_, rand_] := N[(a - N[(N[Sqrt[a], $MachinePrecision] / N[(-3.0 / rand), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  a - \frac{\sqrt{a}}{\frac{-3}{rand}}
                  \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. Applied egg-rr99.8%

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

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

                      \[\leadsto \color{blue}{a} - \sqrt{a + -0.3333333333333333} \cdot \frac{rand}{-3} \]
                    2. Taylor expanded in a around inf

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{\_.f64}\left(a, \left(\frac{rand}{-3} \cdot \sqrt{\color{blue}{a}}\right)\right) \]
                      4. clear-numN/A

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

                        \[\leadsto \mathsf{\_.f64}\left(a, \left(\frac{1}{\color{blue}{\frac{\frac{-3}{rand}}{\sqrt{a}}}}\right)\right) \]
                      6. clear-numN/A

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

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

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

                        \[\leadsto \mathsf{\_.f64}\left(a, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(a\right), \mathsf{/.f64}\left(-3, \color{blue}{rand}\right)\right)\right) \]
                    6. Applied egg-rr98.1%

                      \[\leadsto a - \color{blue}{\frac{\sqrt{a}}{\frac{-3}{rand}}} \]
                    7. Add Preprocessing

                    Alternative 14: 97.8% accurate, 1.1× speedup?

                    \[\begin{array}{l} \\ a - \frac{rand}{-3} \cdot \sqrt{a} \end{array} \]
                    (FPCore (a rand) :precision binary64 (- a (* (/ rand -3.0) (sqrt a))))
                    double code(double a, double rand) {
                    	return a - ((rand / -3.0) * sqrt(a));
                    }
                    
                    real(8) function code(a, rand)
                        real(8), intent (in) :: a
                        real(8), intent (in) :: rand
                        code = a - ((rand / (-3.0d0)) * sqrt(a))
                    end function
                    
                    public static double code(double a, double rand) {
                    	return a - ((rand / -3.0) * Math.sqrt(a));
                    }
                    
                    def code(a, rand):
                    	return a - ((rand / -3.0) * math.sqrt(a))
                    
                    function code(a, rand)
                    	return Float64(a - Float64(Float64(rand / -3.0) * sqrt(a)))
                    end
                    
                    function tmp = code(a, rand)
                    	tmp = a - ((rand / -3.0) * sqrt(a));
                    end
                    
                    code[a_, rand_] := N[(a - N[(N[(rand / -3.0), $MachinePrecision] * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    a - \frac{rand}{-3} \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. Applied egg-rr99.8%

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

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

                        \[\leadsto \color{blue}{a} - \sqrt{a + -0.3333333333333333} \cdot \frac{rand}{-3} \]
                      2. Taylor expanded in a around inf

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

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

                        \[\leadsto a - \color{blue}{\sqrt{a}} \cdot \frac{rand}{-3} \]
                      5. Final simplification98.1%

                        \[\leadsto a - \frac{rand}{-3} \cdot \sqrt{a} \]
                      6. Add Preprocessing

                      Alternative 15: 97.8% accurate, 1.1× speedup?

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

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

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

                          \[\leadsto \color{blue}{a} - \sqrt{a + -0.3333333333333333} \cdot \frac{rand}{-3} \]
                        2. Taylor expanded in a around inf

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

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

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

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

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

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

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

                        Alternative 16: 61.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-+.f6458.8%

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

                          \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
                        8. Final simplification58.8%

                          \[\leadsto a + -0.3333333333333333 \]
                        9. Add Preprocessing

                        Alternative 17: 60.9% 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-+.f6458.8%

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

                          \[\leadsto \color{blue}{-0.3333333333333333 + a} \]
                        8. Taylor expanded in a around inf

                          \[\leadsto \color{blue}{a} \]
                        9. Step-by-step derivation
                          1. Simplified57.8%

                            \[\leadsto \color{blue}{a} \]
                          2. Add Preprocessing

                          Alternative 18: 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-+.f6458.8%

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

                            \[\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.7%

                              \[\leadsto \color{blue}{-0.3333333333333333} \]
                            2. Add Preprocessing

                            Reproduce

                            ?
                            herbie shell --seed 2024164 
                            (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))))