Octave 3.8, oct_fill_randg

Percentage Accurate: 25.0% → 69.1%
Time: 2.6s
Alternatives: 15
Speedup: 1.4×

Specification

?
\[\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} \]
(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)
use fmin_fmax_functions
    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}
t_0 := a - \frac{1}{3}\\
t\_0 \cdot \left(1 + \frac{1}{\sqrt{9 \cdot t\_0}} \cdot rand\right)
\end{array}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 25.0% accurate, 1.0× speedup?

\[\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} \]
(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)
use fmin_fmax_functions
    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}
t_0 := a - \frac{1}{3}\\
t\_0 \cdot \left(1 + \frac{1}{\sqrt{9 \cdot t\_0}} \cdot rand\right)
\end{array}

Alternative 1: 69.1% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \sqrt{\frac{9}{a}}\\ t_1 := rand \cdot \left(a - 0.3333333333333333\right)\\ \mathbf{if}\;a \leq -4.1 \cdot 10^{+157}:\\ \;\;\;\;\frac{t\_1}{\sqrt{\sqrt{\mathsf{fma}\left(9, a, -3\right) \cdot \mathsf{fma}\left(9, a, -3\right)}}}\\ \mathbf{elif}\;a \leq -0.33:\\ \;\;\;\;\frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, 0.037037037037037035\right)}{\mathsf{fma}\left(a, a, \mathsf{fma}\left(-0.3333333333333333, a, 0.1111111111111111\right)\right)}} \cdot 1\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{-162}:\\ \;\;\;\;\frac{{a}^{2}}{a - -0.3333333333333333} \cdot 1\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{+26}:\\ \;\;\;\;\frac{t\_1}{a \cdot \left(\left(t\_0 + -1 \cdot \frac{\mathsf{fma}\left(1.6875, \frac{1}{{a}^{2} \cdot {t\_0}^{5}}, 1.125 \cdot \frac{1}{{t\_0}^{3}}\right)}{{a}^{4}}\right) - \frac{1.5}{{a}^{2} \cdot t\_0}\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)\\ \end{array} \]
(FPCore (a rand)
  :precision binary64
  (let* ((t_0 (sqrt (/ 9.0 a))) (t_1 (* rand (- a 0.3333333333333333))))
  (if (<= a -4.1e+157)
    (/ t_1 (sqrt (sqrt (* (fma 9.0 a -3.0) (fma 9.0 a -3.0)))))
    (if (<= a -0.33)
      (*
       (/
        (fma a a -0.1111111111111111)
        (/
         (fma (* a a) a 0.037037037037037035)
         (fma a a (fma -0.3333333333333333 a 0.1111111111111111))))
       1.0)
      (if (<= a 1.55e-162)
        (* (/ (pow a 2.0) (- a -0.3333333333333333)) 1.0)
        (if (<= a 3.2e+26)
          (/
           t_1
           (*
            a
            (-
             (+
              t_0
              (*
               -1.0
               (/
                (fma
                 1.6875
                 (/ 1.0 (* (pow a 2.0) (pow t_0 5.0)))
                 (* 1.125 (/ 1.0 (pow t_0 3.0))))
                (pow a 4.0))))
             (/ 1.5 (* (pow a 2.0) t_0)))))
          (fma
           (/ (- a 0.3333333333333333) (sqrt (fma 9.0 a -3.0)))
           rand
           (- a 0.3333333333333333))))))))
double code(double a, double rand) {
	double t_0 = sqrt((9.0 / a));
	double t_1 = rand * (a - 0.3333333333333333);
	double tmp;
	if (a <= -4.1e+157) {
		tmp = t_1 / sqrt(sqrt((fma(9.0, a, -3.0) * fma(9.0, a, -3.0))));
	} else if (a <= -0.33) {
		tmp = (fma(a, a, -0.1111111111111111) / (fma((a * a), a, 0.037037037037037035) / fma(a, a, fma(-0.3333333333333333, a, 0.1111111111111111)))) * 1.0;
	} else if (a <= 1.55e-162) {
		tmp = (pow(a, 2.0) / (a - -0.3333333333333333)) * 1.0;
	} else if (a <= 3.2e+26) {
		tmp = t_1 / (a * ((t_0 + (-1.0 * (fma(1.6875, (1.0 / (pow(a, 2.0) * pow(t_0, 5.0))), (1.125 * (1.0 / pow(t_0, 3.0)))) / pow(a, 4.0)))) - (1.5 / (pow(a, 2.0) * t_0))));
	} else {
		tmp = fma(((a - 0.3333333333333333) / sqrt(fma(9.0, a, -3.0))), rand, (a - 0.3333333333333333));
	}
	return tmp;
}
function code(a, rand)
	t_0 = sqrt(Float64(9.0 / a))
	t_1 = Float64(rand * Float64(a - 0.3333333333333333))
	tmp = 0.0
	if (a <= -4.1e+157)
		tmp = Float64(t_1 / sqrt(sqrt(Float64(fma(9.0, a, -3.0) * fma(9.0, a, -3.0)))));
	elseif (a <= -0.33)
		tmp = Float64(Float64(fma(a, a, -0.1111111111111111) / Float64(fma(Float64(a * a), a, 0.037037037037037035) / fma(a, a, fma(-0.3333333333333333, a, 0.1111111111111111)))) * 1.0);
	elseif (a <= 1.55e-162)
		tmp = Float64(Float64((a ^ 2.0) / Float64(a - -0.3333333333333333)) * 1.0);
	elseif (a <= 3.2e+26)
		tmp = Float64(t_1 / Float64(a * Float64(Float64(t_0 + Float64(-1.0 * Float64(fma(1.6875, Float64(1.0 / Float64((a ^ 2.0) * (t_0 ^ 5.0))), Float64(1.125 * Float64(1.0 / (t_0 ^ 3.0)))) / (a ^ 4.0)))) - Float64(1.5 / Float64((a ^ 2.0) * t_0)))));
	else
		tmp = fma(Float64(Float64(a - 0.3333333333333333) / sqrt(fma(9.0, a, -3.0))), rand, Float64(a - 0.3333333333333333));
	end
	return tmp
end
code[a_, rand_] := Block[{t$95$0 = N[Sqrt[N[(9.0 / a), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(rand * N[(a - 0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.1e+157], N[(t$95$1 / N[Sqrt[N[Sqrt[N[(N[(9.0 * a + -3.0), $MachinePrecision] * N[(9.0 * a + -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -0.33], N[(N[(N[(a * a + -0.1111111111111111), $MachinePrecision] / N[(N[(N[(a * a), $MachinePrecision] * a + 0.037037037037037035), $MachinePrecision] / N[(a * a + N[(-0.3333333333333333 * a + 0.1111111111111111), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[a, 1.55e-162], N[(N[(N[Power[a, 2.0], $MachinePrecision] / N[(a - -0.3333333333333333), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[a, 3.2e+26], N[(t$95$1 / N[(a * N[(N[(t$95$0 + N[(-1.0 * N[(N[(1.6875 * N[(1.0 / N[(N[Power[a, 2.0], $MachinePrecision] * N[Power[t$95$0, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.125 * N[(1.0 / N[Power[t$95$0, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[a, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.5 / N[(N[Power[a, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a - 0.3333333333333333), $MachinePrecision] / N[Sqrt[N[(9.0 * a + -3.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * rand + N[(a - 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := \sqrt{\frac{9}{a}}\\
t_1 := rand \cdot \left(a - 0.3333333333333333\right)\\
\mathbf{if}\;a \leq -4.1 \cdot 10^{+157}:\\
\;\;\;\;\frac{t\_1}{\sqrt{\sqrt{\mathsf{fma}\left(9, a, -3\right) \cdot \mathsf{fma}\left(9, a, -3\right)}}}\\

\mathbf{elif}\;a \leq -0.33:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, 0.037037037037037035\right)}{\mathsf{fma}\left(a, a, \mathsf{fma}\left(-0.3333333333333333, a, 0.1111111111111111\right)\right)}} \cdot 1\\

\mathbf{elif}\;a \leq 1.55 \cdot 10^{-162}:\\
\;\;\;\;\frac{{a}^{2}}{a - -0.3333333333333333} \cdot 1\\

\mathbf{elif}\;a \leq 3.2 \cdot 10^{+26}:\\
\;\;\;\;\frac{t\_1}{a \cdot \left(\left(t\_0 + -1 \cdot \frac{\mathsf{fma}\left(1.6875, \frac{1}{{a}^{2} \cdot {t\_0}^{5}}, 1.125 \cdot \frac{1}{{t\_0}^{3}}\right)}{{a}^{4}}\right) - \frac{1.5}{{a}^{2} \cdot t\_0}\right)}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)\\


\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -4.1000000000000002e157

    1. Initial program 25.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. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
      3. lower-*.f6425.0%

        \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
    3. Applied rewrites25.0%

      \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
    4. Taylor expanded in rand around inf

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

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

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

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

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

        \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
      6. lower-sqrt.f64N/A

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

        \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
      8. lower-*.f647.6%

        \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
    6. Applied rewrites7.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{9 \cdot a - 3} \cdot \sqrt{9 \cdot a - 3}}} \]
      16. lift--.f64N/A

        \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{9 \cdot a - 3} \cdot \sqrt{9 \cdot a - 3}}} \]
      17. sqrt-unprodN/A

        \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{\left(9 \cdot a - 3\right) \cdot \left(9 \cdot a - 3\right)}}} \]
      18. lower-sqrt.f64N/A

        \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{\left(9 \cdot a - 3\right) \cdot \left(9 \cdot a - 3\right)}}} \]
      19. lower-*.f6414.8%

        \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{\sqrt{\left(9 \cdot a - 3\right) \cdot \left(9 \cdot a - 3\right)}}} \]
    8. Applied rewrites14.8%

      \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{\sqrt{\mathsf{fma}\left(9, a, -3\right) \cdot \mathsf{fma}\left(9, a, -3\right)}}} \]

    if -4.1000000000000002e157 < a < -0.33000000000000002

    1. Initial program 25.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. Taylor expanded in a around inf

      \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
    3. Step-by-step derivation
      1. Applied rewrites18.0%

        \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
      2. Step-by-step derivation
        1. lift--.f64N/A

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

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

          \[\leadsto \left(a - \color{blue}{\frac{1}{3}}\right) \cdot 1 \]
        4. flip--N/A

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

          \[\leadsto \frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\color{blue}{\frac{1}{3} + a}} \cdot 1 \]
        6. remove-sound-/N/A

          \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
        7. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
        8. fp-cancel-sub-sign-invN/A

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

          \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{3}} \cdot \frac{1}{3}}{\frac{1}{3} + a} \cdot 1 \]
        10. metadata-evalN/A

          \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{9}}}{\frac{1}{3} + a} \cdot 1 \]
        11. metadata-evalN/A

          \[\leadsto \frac{a \cdot a + \color{blue}{\frac{\frac{-1}{3}}{3}}}{\frac{1}{3} + a} \cdot 1 \]
        12. metadata-evalN/A

          \[\leadsto \frac{a \cdot a + \frac{\color{blue}{\mathsf{neg}\left(\frac{1}{3}\right)}}{3}}{\frac{1}{3} + a} \cdot 1 \]
        13. lower-fma.f64N/A

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

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

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \color{blue}{\frac{-1}{9}}\right)}{\frac{1}{3} + a} \cdot 1 \]
        16. +-commutativeN/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a + \frac{1}{3}}} \cdot 1 \]
        17. add-flipN/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
        18. lower--.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
        19. metadata-eval10.8%

          \[\leadsto \frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{a - \color{blue}{-0.3333333333333333}} \cdot 1 \]
      3. Applied rewrites10.8%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{a - -0.3333333333333333}} \cdot 1 \]
      4. Step-by-step derivation
        1. lift--.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \frac{-1}{3}}} \cdot 1 \]
        2. flip3--N/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{\frac{{a}^{3} - {\frac{-1}{3}}^{3}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}}} \cdot 1 \]
        3. remove-sound-/N/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{\frac{{a}^{3} - {\frac{-1}{3}}^{3}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}}} \cdot 1 \]
        4. lower-/.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{\frac{{a}^{3} - {\frac{-1}{3}}^{3}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}}} \cdot 1 \]
        5. sub-flipN/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\color{blue}{{a}^{3} + \left(\mathsf{neg}\left({\frac{-1}{3}}^{3}\right)\right)}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
        6. cube-negN/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{{a}^{3} + \color{blue}{{\left(\mathsf{neg}\left(\frac{-1}{3}\right)\right)}^{3}}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
        7. metadata-evalN/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{{a}^{3} + {\color{blue}{\frac{1}{3}}}^{3}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
        8. unpow3N/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\color{blue}{\left(a \cdot a\right) \cdot a} + {\frac{1}{3}}^{3}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
        9. lower-fma.f64N/A

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

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(\color{blue}{a \cdot a}, a, {\frac{1}{3}}^{3}\right)}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
        11. metadata-evalN/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \color{blue}{\frac{1}{27}}\right)}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
        12. lower-fma.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\color{blue}{\mathsf{fma}\left(a, a, \frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}}} \cdot 1 \]
        13. metadata-evalN/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\mathsf{fma}\left(a, a, \color{blue}{\frac{1}{9}} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
        14. metadata-evalN/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\mathsf{fma}\left(a, a, \color{blue}{\frac{\frac{1}{3}}{3}} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
        15. +-commutativeN/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\mathsf{fma}\left(a, a, \color{blue}{a \cdot \frac{-1}{3} + \frac{\frac{1}{3}}{3}}\right)}} \cdot 1 \]
        16. *-commutativeN/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\mathsf{fma}\left(a, a, \color{blue}{\frac{-1}{3} \cdot a} + \frac{\frac{1}{3}}{3}\right)}} \cdot 1 \]
        17. lower-fma.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\mathsf{fma}\left(a, a, \color{blue}{\mathsf{fma}\left(\frac{-1}{3}, a, \frac{\frac{1}{3}}{3}\right)}\right)}} \cdot 1 \]
        18. metadata-eval10.3%

          \[\leadsto \frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, 0.037037037037037035\right)}{\mathsf{fma}\left(a, a, \mathsf{fma}\left(-0.3333333333333333, a, \color{blue}{0.1111111111111111}\right)\right)}} \cdot 1 \]
      5. Applied rewrites10.3%

        \[\leadsto \frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{\color{blue}{\frac{\mathsf{fma}\left(a \cdot a, a, 0.037037037037037035\right)}{\mathsf{fma}\left(a, a, \mathsf{fma}\left(-0.3333333333333333, a, 0.1111111111111111\right)\right)}}} \cdot 1 \]

      if -0.33000000000000002 < a < 1.5499999999999999e-162

      1. Initial program 25.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. Taylor expanded in a around inf

        \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
      3. Step-by-step derivation
        1. Applied rewrites18.0%

          \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
        2. Step-by-step derivation
          1. lift--.f64N/A

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

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

            \[\leadsto \left(a - \color{blue}{\frac{1}{3}}\right) \cdot 1 \]
          4. flip--N/A

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

            \[\leadsto \frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\color{blue}{\frac{1}{3} + a}} \cdot 1 \]
          6. remove-sound-/N/A

            \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
          7. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
          8. fp-cancel-sub-sign-invN/A

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

            \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{3}} \cdot \frac{1}{3}}{\frac{1}{3} + a} \cdot 1 \]
          10. metadata-evalN/A

            \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{9}}}{\frac{1}{3} + a} \cdot 1 \]
          11. metadata-evalN/A

            \[\leadsto \frac{a \cdot a + \color{blue}{\frac{\frac{-1}{3}}{3}}}{\frac{1}{3} + a} \cdot 1 \]
          12. metadata-evalN/A

            \[\leadsto \frac{a \cdot a + \frac{\color{blue}{\mathsf{neg}\left(\frac{1}{3}\right)}}{3}}{\frac{1}{3} + a} \cdot 1 \]
          13. lower-fma.f64N/A

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

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

            \[\leadsto \frac{\mathsf{fma}\left(a, a, \color{blue}{\frac{-1}{9}}\right)}{\frac{1}{3} + a} \cdot 1 \]
          16. +-commutativeN/A

            \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a + \frac{1}{3}}} \cdot 1 \]
          17. add-flipN/A

            \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
          18. lower--.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
          19. metadata-eval10.8%

            \[\leadsto \frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{a - \color{blue}{-0.3333333333333333}} \cdot 1 \]
        3. Applied rewrites10.8%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{a - -0.3333333333333333}} \cdot 1 \]
        4. Taylor expanded in a around inf

          \[\leadsto \frac{\color{blue}{{a}^{2}}}{a - -0.3333333333333333} \cdot 1 \]
        5. Step-by-step derivation
          1. lower-pow.f6435.7%

            \[\leadsto \frac{{a}^{\color{blue}{2}}}{a - -0.3333333333333333} \cdot 1 \]
        6. Applied rewrites35.7%

          \[\leadsto \frac{\color{blue}{{a}^{2}}}{a - -0.3333333333333333} \cdot 1 \]

        if 1.5499999999999999e-162 < a < 3.2000000000000003e26

        1. Initial program 25.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. lift-*.f64N/A

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

            \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
          3. lower-*.f6425.0%

            \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
        3. Applied rewrites25.0%

          \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
        4. Taylor expanded in rand around inf

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

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

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

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

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

            \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
          6. lower-sqrt.f64N/A

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

            \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
          8. lower-*.f647.6%

            \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
        6. Applied rewrites7.6%

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

          \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{a \cdot \color{blue}{\left(\left(\sqrt{\frac{9}{a}} + -1 \cdot \frac{\frac{27}{16} \cdot \frac{1}{{a}^{2} \cdot {\left(\sqrt{\frac{9}{a}}\right)}^{5}} + \frac{9}{8} \cdot \frac{1}{{\left(\sqrt{\frac{9}{a}}\right)}^{3}}}{{a}^{4}}\right) - \frac{\frac{3}{2}}{{a}^{2} \cdot \sqrt{\frac{9}{a}}}\right)}} \]
        8. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{a \cdot \left(\left(\sqrt{\frac{9}{a}} + -1 \cdot \frac{\frac{27}{16} \cdot \frac{1}{{a}^{2} \cdot {\left(\sqrt{\frac{9}{a}}\right)}^{5}} + \frac{9}{8} \cdot \frac{1}{{\left(\sqrt{\frac{9}{a}}\right)}^{3}}}{{a}^{4}}\right) - \color{blue}{\frac{\frac{3}{2}}{{a}^{2} \cdot \sqrt{\frac{9}{a}}}}\right)} \]
          2. lower--.f64N/A

            \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{a \cdot \left(\left(\sqrt{\frac{9}{a}} + -1 \cdot \frac{\frac{27}{16} \cdot \frac{1}{{a}^{2} \cdot {\left(\sqrt{\frac{9}{a}}\right)}^{5}} + \frac{9}{8} \cdot \frac{1}{{\left(\sqrt{\frac{9}{a}}\right)}^{3}}}{{a}^{4}}\right) - \frac{\frac{3}{2}}{\color{blue}{{a}^{2} \cdot \sqrt{\frac{9}{a}}}}\right)} \]
        9. Applied rewrites12.3%

          \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{a \cdot \color{blue}{\left(\left(\sqrt{\frac{9}{a}} + -1 \cdot \frac{\mathsf{fma}\left(1.6875, \frac{1}{{a}^{2} \cdot {\left(\sqrt{\frac{9}{a}}\right)}^{5}}, 1.125 \cdot \frac{1}{{\left(\sqrt{\frac{9}{a}}\right)}^{3}}\right)}{{a}^{4}}\right) - \frac{1.5}{{a}^{2} \cdot \sqrt{\frac{9}{a}}}\right)}} \]

        if 3.2000000000000003e26 < a

        1. Initial program 25.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(a - \frac{1}{3}\right) \cdot \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}, rand, a - \frac{1}{3}\right)} \]
        3. Applied rewrites25.0%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)} \]
      4. Recombined 5 regimes into one program.
      5. Add Preprocessing

      Alternative 2: 65.9% accurate, 0.2× speedup?

      \[\begin{array}{l} t_0 := rand \cdot \left(a - 0.3333333333333333\right)\\ t_1 := \sqrt{\frac{9}{a}}\\ \mathbf{if}\;a \leq -4.1 \cdot 10^{+157}:\\ \;\;\;\;\frac{t\_0}{\sqrt{\sqrt{\mathsf{fma}\left(9, a, -3\right) \cdot \mathsf{fma}\left(9, a, -3\right)}}}\\ \mathbf{elif}\;a \leq -0.33:\\ \;\;\;\;\frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, 0.037037037037037035\right)}{\mathsf{fma}\left(a, a, \mathsf{fma}\left(-0.3333333333333333, a, 0.1111111111111111\right)\right)}} \cdot 1\\ \mathbf{elif}\;a \leq 2 \cdot 10^{-205}:\\ \;\;\;\;\frac{{a}^{2}}{a - -0.3333333333333333} \cdot 1\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{+26}:\\ \;\;\;\;\frac{t\_0}{a \cdot \left(t\_1 + -1 \cdot \frac{\mathsf{fma}\left(1.5, \frac{1}{t\_1}, 1.125 \cdot \frac{1}{{a}^{2} \cdot {t\_1}^{3}}\right)}{{a}^{2}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)\\ \end{array} \]
      (FPCore (a rand)
        :precision binary64
        (let* ((t_0 (* rand (- a 0.3333333333333333))) (t_1 (sqrt (/ 9.0 a))))
        (if (<= a -4.1e+157)
          (/ t_0 (sqrt (sqrt (* (fma 9.0 a -3.0) (fma 9.0 a -3.0)))))
          (if (<= a -0.33)
            (*
             (/
              (fma a a -0.1111111111111111)
              (/
               (fma (* a a) a 0.037037037037037035)
               (fma a a (fma -0.3333333333333333 a 0.1111111111111111))))
             1.0)
            (if (<= a 2e-205)
              (* (/ (pow a 2.0) (- a -0.3333333333333333)) 1.0)
              (if (<= a 3.2e+26)
                (/
                 t_0
                 (*
                  a
                  (+
                   t_1
                   (*
                    -1.0
                    (/
                     (fma
                      1.5
                      (/ 1.0 t_1)
                      (* 1.125 (/ 1.0 (* (pow a 2.0) (pow t_1 3.0)))))
                     (pow a 2.0))))))
                (fma
                 (/ (- a 0.3333333333333333) (sqrt (fma 9.0 a -3.0)))
                 rand
                 (- a 0.3333333333333333))))))))
      double code(double a, double rand) {
      	double t_0 = rand * (a - 0.3333333333333333);
      	double t_1 = sqrt((9.0 / a));
      	double tmp;
      	if (a <= -4.1e+157) {
      		tmp = t_0 / sqrt(sqrt((fma(9.0, a, -3.0) * fma(9.0, a, -3.0))));
      	} else if (a <= -0.33) {
      		tmp = (fma(a, a, -0.1111111111111111) / (fma((a * a), a, 0.037037037037037035) / fma(a, a, fma(-0.3333333333333333, a, 0.1111111111111111)))) * 1.0;
      	} else if (a <= 2e-205) {
      		tmp = (pow(a, 2.0) / (a - -0.3333333333333333)) * 1.0;
      	} else if (a <= 3.2e+26) {
      		tmp = t_0 / (a * (t_1 + (-1.0 * (fma(1.5, (1.0 / t_1), (1.125 * (1.0 / (pow(a, 2.0) * pow(t_1, 3.0))))) / pow(a, 2.0)))));
      	} else {
      		tmp = fma(((a - 0.3333333333333333) / sqrt(fma(9.0, a, -3.0))), rand, (a - 0.3333333333333333));
      	}
      	return tmp;
      }
      
      function code(a, rand)
      	t_0 = Float64(rand * Float64(a - 0.3333333333333333))
      	t_1 = sqrt(Float64(9.0 / a))
      	tmp = 0.0
      	if (a <= -4.1e+157)
      		tmp = Float64(t_0 / sqrt(sqrt(Float64(fma(9.0, a, -3.0) * fma(9.0, a, -3.0)))));
      	elseif (a <= -0.33)
      		tmp = Float64(Float64(fma(a, a, -0.1111111111111111) / Float64(fma(Float64(a * a), a, 0.037037037037037035) / fma(a, a, fma(-0.3333333333333333, a, 0.1111111111111111)))) * 1.0);
      	elseif (a <= 2e-205)
      		tmp = Float64(Float64((a ^ 2.0) / Float64(a - -0.3333333333333333)) * 1.0);
      	elseif (a <= 3.2e+26)
      		tmp = Float64(t_0 / Float64(a * Float64(t_1 + Float64(-1.0 * Float64(fma(1.5, Float64(1.0 / t_1), Float64(1.125 * Float64(1.0 / Float64((a ^ 2.0) * (t_1 ^ 3.0))))) / (a ^ 2.0))))));
      	else
      		tmp = fma(Float64(Float64(a - 0.3333333333333333) / sqrt(fma(9.0, a, -3.0))), rand, Float64(a - 0.3333333333333333));
      	end
      	return tmp
      end
      
      code[a_, rand_] := Block[{t$95$0 = N[(rand * N[(a - 0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(9.0 / a), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a, -4.1e+157], N[(t$95$0 / N[Sqrt[N[Sqrt[N[(N[(9.0 * a + -3.0), $MachinePrecision] * N[(9.0 * a + -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -0.33], N[(N[(N[(a * a + -0.1111111111111111), $MachinePrecision] / N[(N[(N[(a * a), $MachinePrecision] * a + 0.037037037037037035), $MachinePrecision] / N[(a * a + N[(-0.3333333333333333 * a + 0.1111111111111111), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[a, 2e-205], N[(N[(N[Power[a, 2.0], $MachinePrecision] / N[(a - -0.3333333333333333), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[a, 3.2e+26], N[(t$95$0 / N[(a * N[(t$95$1 + N[(-1.0 * N[(N[(1.5 * N[(1.0 / t$95$1), $MachinePrecision] + N[(1.125 * N[(1.0 / N[(N[Power[a, 2.0], $MachinePrecision] * N[Power[t$95$1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a - 0.3333333333333333), $MachinePrecision] / N[Sqrt[N[(9.0 * a + -3.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * rand + N[(a - 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]]]]]
      
      \begin{array}{l}
      t_0 := rand \cdot \left(a - 0.3333333333333333\right)\\
      t_1 := \sqrt{\frac{9}{a}}\\
      \mathbf{if}\;a \leq -4.1 \cdot 10^{+157}:\\
      \;\;\;\;\frac{t\_0}{\sqrt{\sqrt{\mathsf{fma}\left(9, a, -3\right) \cdot \mathsf{fma}\left(9, a, -3\right)}}}\\
      
      \mathbf{elif}\;a \leq -0.33:\\
      \;\;\;\;\frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, 0.037037037037037035\right)}{\mathsf{fma}\left(a, a, \mathsf{fma}\left(-0.3333333333333333, a, 0.1111111111111111\right)\right)}} \cdot 1\\
      
      \mathbf{elif}\;a \leq 2 \cdot 10^{-205}:\\
      \;\;\;\;\frac{{a}^{2}}{a - -0.3333333333333333} \cdot 1\\
      
      \mathbf{elif}\;a \leq 3.2 \cdot 10^{+26}:\\
      \;\;\;\;\frac{t\_0}{a \cdot \left(t\_1 + -1 \cdot \frac{\mathsf{fma}\left(1.5, \frac{1}{t\_1}, 1.125 \cdot \frac{1}{{a}^{2} \cdot {t\_1}^{3}}\right)}{{a}^{2}}\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 5 regimes
      2. if a < -4.1000000000000002e157

        1. Initial program 25.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. lift-*.f64N/A

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

            \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
          3. lower-*.f6425.0%

            \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
        3. Applied rewrites25.0%

          \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
        4. Taylor expanded in rand around inf

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

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

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

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

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

            \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
          6. lower-sqrt.f64N/A

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

            \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
          8. lower-*.f647.6%

            \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
        6. Applied rewrites7.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{9 \cdot a - 3} \cdot \sqrt{9 \cdot a - 3}}} \]
          16. lift--.f64N/A

            \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{9 \cdot a - 3} \cdot \sqrt{9 \cdot a - 3}}} \]
          17. sqrt-unprodN/A

            \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{\left(9 \cdot a - 3\right) \cdot \left(9 \cdot a - 3\right)}}} \]
          18. lower-sqrt.f64N/A

            \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{\left(9 \cdot a - 3\right) \cdot \left(9 \cdot a - 3\right)}}} \]
          19. lower-*.f6414.8%

            \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{\sqrt{\left(9 \cdot a - 3\right) \cdot \left(9 \cdot a - 3\right)}}} \]
        8. Applied rewrites14.8%

          \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{\sqrt{\mathsf{fma}\left(9, a, -3\right) \cdot \mathsf{fma}\left(9, a, -3\right)}}} \]

        if -4.1000000000000002e157 < a < -0.33000000000000002

        1. Initial program 25.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. Taylor expanded in a around inf

          \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
        3. Step-by-step derivation
          1. Applied rewrites18.0%

            \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
          2. Step-by-step derivation
            1. lift--.f64N/A

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

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

              \[\leadsto \left(a - \color{blue}{\frac{1}{3}}\right) \cdot 1 \]
            4. flip--N/A

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

              \[\leadsto \frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\color{blue}{\frac{1}{3} + a}} \cdot 1 \]
            6. remove-sound-/N/A

              \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
            7. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
            8. fp-cancel-sub-sign-invN/A

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

              \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{3}} \cdot \frac{1}{3}}{\frac{1}{3} + a} \cdot 1 \]
            10. metadata-evalN/A

              \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{9}}}{\frac{1}{3} + a} \cdot 1 \]
            11. metadata-evalN/A

              \[\leadsto \frac{a \cdot a + \color{blue}{\frac{\frac{-1}{3}}{3}}}{\frac{1}{3} + a} \cdot 1 \]
            12. metadata-evalN/A

              \[\leadsto \frac{a \cdot a + \frac{\color{blue}{\mathsf{neg}\left(\frac{1}{3}\right)}}{3}}{\frac{1}{3} + a} \cdot 1 \]
            13. lower-fma.f64N/A

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

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

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \color{blue}{\frac{-1}{9}}\right)}{\frac{1}{3} + a} \cdot 1 \]
            16. +-commutativeN/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a + \frac{1}{3}}} \cdot 1 \]
            17. add-flipN/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
            18. lower--.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
            19. metadata-eval10.8%

              \[\leadsto \frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{a - \color{blue}{-0.3333333333333333}} \cdot 1 \]
          3. Applied rewrites10.8%

            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{a - -0.3333333333333333}} \cdot 1 \]
          4. Step-by-step derivation
            1. lift--.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \frac{-1}{3}}} \cdot 1 \]
            2. flip3--N/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{\frac{{a}^{3} - {\frac{-1}{3}}^{3}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}}} \cdot 1 \]
            3. remove-sound-/N/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{\frac{{a}^{3} - {\frac{-1}{3}}^{3}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}}} \cdot 1 \]
            4. lower-/.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{\frac{{a}^{3} - {\frac{-1}{3}}^{3}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}}} \cdot 1 \]
            5. sub-flipN/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\color{blue}{{a}^{3} + \left(\mathsf{neg}\left({\frac{-1}{3}}^{3}\right)\right)}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
            6. cube-negN/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{{a}^{3} + \color{blue}{{\left(\mathsf{neg}\left(\frac{-1}{3}\right)\right)}^{3}}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
            7. metadata-evalN/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{{a}^{3} + {\color{blue}{\frac{1}{3}}}^{3}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
            8. unpow3N/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\color{blue}{\left(a \cdot a\right) \cdot a} + {\frac{1}{3}}^{3}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
            9. lower-fma.f64N/A

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

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(\color{blue}{a \cdot a}, a, {\frac{1}{3}}^{3}\right)}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
            11. metadata-evalN/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \color{blue}{\frac{1}{27}}\right)}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
            12. lower-fma.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\color{blue}{\mathsf{fma}\left(a, a, \frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}}} \cdot 1 \]
            13. metadata-evalN/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\mathsf{fma}\left(a, a, \color{blue}{\frac{1}{9}} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
            14. metadata-evalN/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\mathsf{fma}\left(a, a, \color{blue}{\frac{\frac{1}{3}}{3}} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
            15. +-commutativeN/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\mathsf{fma}\left(a, a, \color{blue}{a \cdot \frac{-1}{3} + \frac{\frac{1}{3}}{3}}\right)}} \cdot 1 \]
            16. *-commutativeN/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\mathsf{fma}\left(a, a, \color{blue}{\frac{-1}{3} \cdot a} + \frac{\frac{1}{3}}{3}\right)}} \cdot 1 \]
            17. lower-fma.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\mathsf{fma}\left(a, a, \color{blue}{\mathsf{fma}\left(\frac{-1}{3}, a, \frac{\frac{1}{3}}{3}\right)}\right)}} \cdot 1 \]
            18. metadata-eval10.3%

              \[\leadsto \frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, 0.037037037037037035\right)}{\mathsf{fma}\left(a, a, \mathsf{fma}\left(-0.3333333333333333, a, \color{blue}{0.1111111111111111}\right)\right)}} \cdot 1 \]
          5. Applied rewrites10.3%

            \[\leadsto \frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{\color{blue}{\frac{\mathsf{fma}\left(a \cdot a, a, 0.037037037037037035\right)}{\mathsf{fma}\left(a, a, \mathsf{fma}\left(-0.3333333333333333, a, 0.1111111111111111\right)\right)}}} \cdot 1 \]

          if -0.33000000000000002 < a < 2e-205

          1. Initial program 25.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. Taylor expanded in a around inf

            \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
          3. Step-by-step derivation
            1. Applied rewrites18.0%

              \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
            2. Step-by-step derivation
              1. lift--.f64N/A

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

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

                \[\leadsto \left(a - \color{blue}{\frac{1}{3}}\right) \cdot 1 \]
              4. flip--N/A

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

                \[\leadsto \frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\color{blue}{\frac{1}{3} + a}} \cdot 1 \]
              6. remove-sound-/N/A

                \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
              7. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
              8. fp-cancel-sub-sign-invN/A

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

                \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{3}} \cdot \frac{1}{3}}{\frac{1}{3} + a} \cdot 1 \]
              10. metadata-evalN/A

                \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{9}}}{\frac{1}{3} + a} \cdot 1 \]
              11. metadata-evalN/A

                \[\leadsto \frac{a \cdot a + \color{blue}{\frac{\frac{-1}{3}}{3}}}{\frac{1}{3} + a} \cdot 1 \]
              12. metadata-evalN/A

                \[\leadsto \frac{a \cdot a + \frac{\color{blue}{\mathsf{neg}\left(\frac{1}{3}\right)}}{3}}{\frac{1}{3} + a} \cdot 1 \]
              13. lower-fma.f64N/A

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

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

                \[\leadsto \frac{\mathsf{fma}\left(a, a, \color{blue}{\frac{-1}{9}}\right)}{\frac{1}{3} + a} \cdot 1 \]
              16. +-commutativeN/A

                \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a + \frac{1}{3}}} \cdot 1 \]
              17. add-flipN/A

                \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
              18. lower--.f64N/A

                \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
              19. metadata-eval10.8%

                \[\leadsto \frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{a - \color{blue}{-0.3333333333333333}} \cdot 1 \]
            3. Applied rewrites10.8%

              \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{a - -0.3333333333333333}} \cdot 1 \]
            4. Taylor expanded in a around inf

              \[\leadsto \frac{\color{blue}{{a}^{2}}}{a - -0.3333333333333333} \cdot 1 \]
            5. Step-by-step derivation
              1. lower-pow.f6435.7%

                \[\leadsto \frac{{a}^{\color{blue}{2}}}{a - -0.3333333333333333} \cdot 1 \]
            6. Applied rewrites35.7%

              \[\leadsto \frac{\color{blue}{{a}^{2}}}{a - -0.3333333333333333} \cdot 1 \]

            if 2e-205 < a < 3.2000000000000003e26

            1. Initial program 25.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. lift-*.f64N/A

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

                \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
              3. lower-*.f6425.0%

                \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
            3. Applied rewrites25.0%

              \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
            4. Taylor expanded in rand around inf

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

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

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

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

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

                \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
              6. lower-sqrt.f64N/A

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

                \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
              8. lower-*.f647.6%

                \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
            6. Applied rewrites7.6%

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

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

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

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

                \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{a \cdot \left(\sqrt{\frac{9}{a}} + -1 \cdot \frac{\color{blue}{\frac{3}{2} \cdot \frac{1}{\sqrt{\frac{9}{a}}} + \frac{9}{8} \cdot \frac{1}{{a}^{2} \cdot {\left(\sqrt{\frac{9}{a}}\right)}^{3}}}}{{a}^{2}}\right)} \]
              4. lower-/.f64N/A

                \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{a \cdot \left(\sqrt{\frac{9}{a}} + -1 \cdot \frac{\color{blue}{\frac{3}{2} \cdot \frac{1}{\sqrt{\frac{9}{a}}}} + \frac{9}{8} \cdot \frac{1}{{a}^{2} \cdot {\left(\sqrt{\frac{9}{a}}\right)}^{3}}}{{a}^{2}}\right)} \]
              5. lower-*.f64N/A

                \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{a \cdot \left(\sqrt{\frac{9}{a}} + -1 \cdot \frac{\frac{3}{2} \cdot \frac{1}{\sqrt{\frac{9}{a}}} + \frac{9}{8} \cdot \frac{1}{{a}^{2} \cdot {\left(\sqrt{\frac{9}{a}}\right)}^{3}}}{\color{blue}{{a}^{2}}}\right)} \]
              6. lower-/.f64N/A

                \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{a \cdot \left(\sqrt{\frac{9}{a}} + -1 \cdot \frac{\frac{3}{2} \cdot \frac{1}{\sqrt{\frac{9}{a}}} + \frac{9}{8} \cdot \frac{1}{{a}^{2} \cdot {\left(\sqrt{\frac{9}{a}}\right)}^{3}}}{{a}^{\color{blue}{2}}}\right)} \]
            9. Applied rewrites13.9%

              \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{a \cdot \color{blue}{\left(\sqrt{\frac{9}{a}} + -1 \cdot \frac{\mathsf{fma}\left(1.5, \frac{1}{\sqrt{\frac{9}{a}}}, 1.125 \cdot \frac{1}{{a}^{2} \cdot {\left(\sqrt{\frac{9}{a}}\right)}^{3}}\right)}{{a}^{2}}\right)}} \]

            if 3.2000000000000003e26 < a

            1. Initial program 25.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(\left(a - \frac{1}{3}\right) \cdot \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}, rand, a - \frac{1}{3}\right)} \]
            3. Applied rewrites25.0%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)} \]
          4. Recombined 5 regimes into one program.
          5. Add Preprocessing

          Alternative 3: 63.2% accurate, 0.7× speedup?

          \[\begin{array}{l} \mathbf{if}\;a \leq -4.1 \cdot 10^{+157}:\\ \;\;\;\;\frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{\sqrt{\mathsf{fma}\left(9, a, -3\right) \cdot \mathsf{fma}\left(9, a, -3\right)}}}\\ \mathbf{elif}\;a \leq -0.33:\\ \;\;\;\;\frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, 0.037037037037037035\right)}{\mathsf{fma}\left(a, a, \mathsf{fma}\left(-0.3333333333333333, a, 0.1111111111111111\right)\right)}} \cdot 1\\ \mathbf{elif}\;a \leq 0.35:\\ \;\;\;\;\frac{{a}^{2}}{a - -0.3333333333333333} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)\\ \end{array} \]
          (FPCore (a rand)
            :precision binary64
            (if (<= a -4.1e+157)
            (/
             (* rand (- a 0.3333333333333333))
             (sqrt (sqrt (* (fma 9.0 a -3.0) (fma 9.0 a -3.0)))))
            (if (<= a -0.33)
              (*
               (/
                (fma a a -0.1111111111111111)
                (/
                 (fma (* a a) a 0.037037037037037035)
                 (fma a a (fma -0.3333333333333333 a 0.1111111111111111))))
               1.0)
              (if (<= a 0.35)
                (* (/ (pow a 2.0) (- a -0.3333333333333333)) 1.0)
                (fma
                 (/ (- a 0.3333333333333333) (sqrt (fma 9.0 a -3.0)))
                 rand
                 (- a 0.3333333333333333))))))
          double code(double a, double rand) {
          	double tmp;
          	if (a <= -4.1e+157) {
          		tmp = (rand * (a - 0.3333333333333333)) / sqrt(sqrt((fma(9.0, a, -3.0) * fma(9.0, a, -3.0))));
          	} else if (a <= -0.33) {
          		tmp = (fma(a, a, -0.1111111111111111) / (fma((a * a), a, 0.037037037037037035) / fma(a, a, fma(-0.3333333333333333, a, 0.1111111111111111)))) * 1.0;
          	} else if (a <= 0.35) {
          		tmp = (pow(a, 2.0) / (a - -0.3333333333333333)) * 1.0;
          	} else {
          		tmp = fma(((a - 0.3333333333333333) / sqrt(fma(9.0, a, -3.0))), rand, (a - 0.3333333333333333));
          	}
          	return tmp;
          }
          
          function code(a, rand)
          	tmp = 0.0
          	if (a <= -4.1e+157)
          		tmp = Float64(Float64(rand * Float64(a - 0.3333333333333333)) / sqrt(sqrt(Float64(fma(9.0, a, -3.0) * fma(9.0, a, -3.0)))));
          	elseif (a <= -0.33)
          		tmp = Float64(Float64(fma(a, a, -0.1111111111111111) / Float64(fma(Float64(a * a), a, 0.037037037037037035) / fma(a, a, fma(-0.3333333333333333, a, 0.1111111111111111)))) * 1.0);
          	elseif (a <= 0.35)
          		tmp = Float64(Float64((a ^ 2.0) / Float64(a - -0.3333333333333333)) * 1.0);
          	else
          		tmp = fma(Float64(Float64(a - 0.3333333333333333) / sqrt(fma(9.0, a, -3.0))), rand, Float64(a - 0.3333333333333333));
          	end
          	return tmp
          end
          
          code[a_, rand_] := If[LessEqual[a, -4.1e+157], N[(N[(rand * N[(a - 0.3333333333333333), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sqrt[N[(N[(9.0 * a + -3.0), $MachinePrecision] * N[(9.0 * a + -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -0.33], N[(N[(N[(a * a + -0.1111111111111111), $MachinePrecision] / N[(N[(N[(a * a), $MachinePrecision] * a + 0.037037037037037035), $MachinePrecision] / N[(a * a + N[(-0.3333333333333333 * a + 0.1111111111111111), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[a, 0.35], N[(N[(N[Power[a, 2.0], $MachinePrecision] / N[(a - -0.3333333333333333), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(N[(a - 0.3333333333333333), $MachinePrecision] / N[Sqrt[N[(9.0 * a + -3.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * rand + N[(a - 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          \mathbf{if}\;a \leq -4.1 \cdot 10^{+157}:\\
          \;\;\;\;\frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{\sqrt{\mathsf{fma}\left(9, a, -3\right) \cdot \mathsf{fma}\left(9, a, -3\right)}}}\\
          
          \mathbf{elif}\;a \leq -0.33:\\
          \;\;\;\;\frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, 0.037037037037037035\right)}{\mathsf{fma}\left(a, a, \mathsf{fma}\left(-0.3333333333333333, a, 0.1111111111111111\right)\right)}} \cdot 1\\
          
          \mathbf{elif}\;a \leq 0.35:\\
          \;\;\;\;\frac{{a}^{2}}{a - -0.3333333333333333} \cdot 1\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if a < -4.1000000000000002e157

            1. Initial program 25.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. lift-*.f64N/A

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

                \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
              3. lower-*.f6425.0%

                \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
            3. Applied rewrites25.0%

              \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
            4. Taylor expanded in rand around inf

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

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

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

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

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

                \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
              6. lower-sqrt.f64N/A

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

                \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
              8. lower-*.f647.6%

                \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
            6. Applied rewrites7.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{9 \cdot a - 3} \cdot \sqrt{9 \cdot a - 3}}} \]
              16. lift--.f64N/A

                \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{9 \cdot a - 3} \cdot \sqrt{9 \cdot a - 3}}} \]
              17. sqrt-unprodN/A

                \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{\left(9 \cdot a - 3\right) \cdot \left(9 \cdot a - 3\right)}}} \]
              18. lower-sqrt.f64N/A

                \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{\left(9 \cdot a - 3\right) \cdot \left(9 \cdot a - 3\right)}}} \]
              19. lower-*.f6414.8%

                \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{\sqrt{\left(9 \cdot a - 3\right) \cdot \left(9 \cdot a - 3\right)}}} \]
            8. Applied rewrites14.8%

              \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{\sqrt{\mathsf{fma}\left(9, a, -3\right) \cdot \mathsf{fma}\left(9, a, -3\right)}}} \]

            if -4.1000000000000002e157 < a < -0.33000000000000002

            1. Initial program 25.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. Taylor expanded in a around inf

              \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
            3. Step-by-step derivation
              1. Applied rewrites18.0%

                \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
              2. Step-by-step derivation
                1. lift--.f64N/A

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

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

                  \[\leadsto \left(a - \color{blue}{\frac{1}{3}}\right) \cdot 1 \]
                4. flip--N/A

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

                  \[\leadsto \frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\color{blue}{\frac{1}{3} + a}} \cdot 1 \]
                6. remove-sound-/N/A

                  \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
                7. lower-/.f64N/A

                  \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
                8. fp-cancel-sub-sign-invN/A

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

                  \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{3}} \cdot \frac{1}{3}}{\frac{1}{3} + a} \cdot 1 \]
                10. metadata-evalN/A

                  \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{9}}}{\frac{1}{3} + a} \cdot 1 \]
                11. metadata-evalN/A

                  \[\leadsto \frac{a \cdot a + \color{blue}{\frac{\frac{-1}{3}}{3}}}{\frac{1}{3} + a} \cdot 1 \]
                12. metadata-evalN/A

                  \[\leadsto \frac{a \cdot a + \frac{\color{blue}{\mathsf{neg}\left(\frac{1}{3}\right)}}{3}}{\frac{1}{3} + a} \cdot 1 \]
                13. lower-fma.f64N/A

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

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

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \color{blue}{\frac{-1}{9}}\right)}{\frac{1}{3} + a} \cdot 1 \]
                16. +-commutativeN/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a + \frac{1}{3}}} \cdot 1 \]
                17. add-flipN/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
                18. lower--.f64N/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
                19. metadata-eval10.8%

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{a - \color{blue}{-0.3333333333333333}} \cdot 1 \]
              3. Applied rewrites10.8%

                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{a - -0.3333333333333333}} \cdot 1 \]
              4. Step-by-step derivation
                1. lift--.f64N/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \frac{-1}{3}}} \cdot 1 \]
                2. flip3--N/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{\frac{{a}^{3} - {\frac{-1}{3}}^{3}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}}} \cdot 1 \]
                3. remove-sound-/N/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{\frac{{a}^{3} - {\frac{-1}{3}}^{3}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}}} \cdot 1 \]
                4. lower-/.f64N/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{\frac{{a}^{3} - {\frac{-1}{3}}^{3}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}}} \cdot 1 \]
                5. sub-flipN/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\color{blue}{{a}^{3} + \left(\mathsf{neg}\left({\frac{-1}{3}}^{3}\right)\right)}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
                6. cube-negN/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{{a}^{3} + \color{blue}{{\left(\mathsf{neg}\left(\frac{-1}{3}\right)\right)}^{3}}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
                7. metadata-evalN/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{{a}^{3} + {\color{blue}{\frac{1}{3}}}^{3}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
                8. unpow3N/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\color{blue}{\left(a \cdot a\right) \cdot a} + {\frac{1}{3}}^{3}}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
                9. lower-fma.f64N/A

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

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(\color{blue}{a \cdot a}, a, {\frac{1}{3}}^{3}\right)}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
                11. metadata-evalN/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \color{blue}{\frac{1}{27}}\right)}{a \cdot a + \left(\frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
                12. lower-fma.f64N/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\color{blue}{\mathsf{fma}\left(a, a, \frac{-1}{3} \cdot \frac{-1}{3} + a \cdot \frac{-1}{3}\right)}}} \cdot 1 \]
                13. metadata-evalN/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\mathsf{fma}\left(a, a, \color{blue}{\frac{1}{9}} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
                14. metadata-evalN/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\mathsf{fma}\left(a, a, \color{blue}{\frac{\frac{1}{3}}{3}} + a \cdot \frac{-1}{3}\right)}} \cdot 1 \]
                15. +-commutativeN/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\mathsf{fma}\left(a, a, \color{blue}{a \cdot \frac{-1}{3} + \frac{\frac{1}{3}}{3}}\right)}} \cdot 1 \]
                16. *-commutativeN/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\mathsf{fma}\left(a, a, \color{blue}{\frac{-1}{3} \cdot a} + \frac{\frac{1}{3}}{3}\right)}} \cdot 1 \]
                17. lower-fma.f64N/A

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, \frac{1}{27}\right)}{\mathsf{fma}\left(a, a, \color{blue}{\mathsf{fma}\left(\frac{-1}{3}, a, \frac{\frac{1}{3}}{3}\right)}\right)}} \cdot 1 \]
                18. metadata-eval10.3%

                  \[\leadsto \frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{\frac{\mathsf{fma}\left(a \cdot a, a, 0.037037037037037035\right)}{\mathsf{fma}\left(a, a, \mathsf{fma}\left(-0.3333333333333333, a, \color{blue}{0.1111111111111111}\right)\right)}} \cdot 1 \]
              5. Applied rewrites10.3%

                \[\leadsto \frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{\color{blue}{\frac{\mathsf{fma}\left(a \cdot a, a, 0.037037037037037035\right)}{\mathsf{fma}\left(a, a, \mathsf{fma}\left(-0.3333333333333333, a, 0.1111111111111111\right)\right)}}} \cdot 1 \]

              if -0.33000000000000002 < a < 0.34999999999999998

              1. Initial program 25.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. Taylor expanded in a around inf

                \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
              3. Step-by-step derivation
                1. Applied rewrites18.0%

                  \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
                2. Step-by-step derivation
                  1. lift--.f64N/A

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

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

                    \[\leadsto \left(a - \color{blue}{\frac{1}{3}}\right) \cdot 1 \]
                  4. flip--N/A

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

                    \[\leadsto \frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\color{blue}{\frac{1}{3} + a}} \cdot 1 \]
                  6. remove-sound-/N/A

                    \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
                  7. lower-/.f64N/A

                    \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
                  8. fp-cancel-sub-sign-invN/A

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

                    \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{3}} \cdot \frac{1}{3}}{\frac{1}{3} + a} \cdot 1 \]
                  10. metadata-evalN/A

                    \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{9}}}{\frac{1}{3} + a} \cdot 1 \]
                  11. metadata-evalN/A

                    \[\leadsto \frac{a \cdot a + \color{blue}{\frac{\frac{-1}{3}}{3}}}{\frac{1}{3} + a} \cdot 1 \]
                  12. metadata-evalN/A

                    \[\leadsto \frac{a \cdot a + \frac{\color{blue}{\mathsf{neg}\left(\frac{1}{3}\right)}}{3}}{\frac{1}{3} + a} \cdot 1 \]
                  13. lower-fma.f64N/A

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

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

                    \[\leadsto \frac{\mathsf{fma}\left(a, a, \color{blue}{\frac{-1}{9}}\right)}{\frac{1}{3} + a} \cdot 1 \]
                  16. +-commutativeN/A

                    \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a + \frac{1}{3}}} \cdot 1 \]
                  17. add-flipN/A

                    \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
                  18. lower--.f64N/A

                    \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
                  19. metadata-eval10.8%

                    \[\leadsto \frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{a - \color{blue}{-0.3333333333333333}} \cdot 1 \]
                3. Applied rewrites10.8%

                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{a - -0.3333333333333333}} \cdot 1 \]
                4. Taylor expanded in a around inf

                  \[\leadsto \frac{\color{blue}{{a}^{2}}}{a - -0.3333333333333333} \cdot 1 \]
                5. Step-by-step derivation
                  1. lower-pow.f6435.7%

                    \[\leadsto \frac{{a}^{\color{blue}{2}}}{a - -0.3333333333333333} \cdot 1 \]
                6. Applied rewrites35.7%

                  \[\leadsto \frac{\color{blue}{{a}^{2}}}{a - -0.3333333333333333} \cdot 1 \]

                if 0.34999999999999998 < a

                1. Initial program 25.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(a - \frac{1}{3}\right) \cdot \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}, rand, a - \frac{1}{3}\right)} \]
                3. Applied rewrites25.0%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)} \]
              4. Recombined 4 regimes into one program.
              5. Add Preprocessing

              Alternative 4: 59.7% accurate, 0.9× speedup?

              \[\begin{array}{l} \mathbf{if}\;a \leq -3.2 \cdot 10^{-69}:\\ \;\;\;\;\frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{\sqrt{\mathsf{fma}\left(9, a, -3\right) \cdot \mathsf{fma}\left(9, a, -3\right)}}}\\ \mathbf{elif}\;a \leq 0.35:\\ \;\;\;\;\frac{{a}^{2}}{a - -0.3333333333333333} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)\\ \end{array} \]
              (FPCore (a rand)
                :precision binary64
                (if (<= a -3.2e-69)
                (/
                 (* rand (- a 0.3333333333333333))
                 (sqrt (sqrt (* (fma 9.0 a -3.0) (fma 9.0 a -3.0)))))
                (if (<= a 0.35)
                  (* (/ (pow a 2.0) (- a -0.3333333333333333)) 1.0)
                  (fma
                   (/ (- a 0.3333333333333333) (sqrt (fma 9.0 a -3.0)))
                   rand
                   (- a 0.3333333333333333)))))
              double code(double a, double rand) {
              	double tmp;
              	if (a <= -3.2e-69) {
              		tmp = (rand * (a - 0.3333333333333333)) / sqrt(sqrt((fma(9.0, a, -3.0) * fma(9.0, a, -3.0))));
              	} else if (a <= 0.35) {
              		tmp = (pow(a, 2.0) / (a - -0.3333333333333333)) * 1.0;
              	} else {
              		tmp = fma(((a - 0.3333333333333333) / sqrt(fma(9.0, a, -3.0))), rand, (a - 0.3333333333333333));
              	}
              	return tmp;
              }
              
              function code(a, rand)
              	tmp = 0.0
              	if (a <= -3.2e-69)
              		tmp = Float64(Float64(rand * Float64(a - 0.3333333333333333)) / sqrt(sqrt(Float64(fma(9.0, a, -3.0) * fma(9.0, a, -3.0)))));
              	elseif (a <= 0.35)
              		tmp = Float64(Float64((a ^ 2.0) / Float64(a - -0.3333333333333333)) * 1.0);
              	else
              		tmp = fma(Float64(Float64(a - 0.3333333333333333) / sqrt(fma(9.0, a, -3.0))), rand, Float64(a - 0.3333333333333333));
              	end
              	return tmp
              end
              
              code[a_, rand_] := If[LessEqual[a, -3.2e-69], N[(N[(rand * N[(a - 0.3333333333333333), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sqrt[N[(N[(9.0 * a + -3.0), $MachinePrecision] * N[(9.0 * a + -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 0.35], N[(N[(N[Power[a, 2.0], $MachinePrecision] / N[(a - -0.3333333333333333), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(N[(a - 0.3333333333333333), $MachinePrecision] / N[Sqrt[N[(9.0 * a + -3.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * rand + N[(a - 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              \mathbf{if}\;a \leq -3.2 \cdot 10^{-69}:\\
              \;\;\;\;\frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{\sqrt{\mathsf{fma}\left(9, a, -3\right) \cdot \mathsf{fma}\left(9, a, -3\right)}}}\\
              
              \mathbf{elif}\;a \leq 0.35:\\
              \;\;\;\;\frac{{a}^{2}}{a - -0.3333333333333333} \cdot 1\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if a < -3.2e-69

                1. Initial program 25.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. lift-*.f64N/A

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

                    \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                  3. lower-*.f6425.0%

                    \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                3. Applied rewrites25.0%

                  \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
                4. Taylor expanded in rand around inf

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

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

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

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

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

                    \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                  6. lower-sqrt.f64N/A

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

                    \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                  8. lower-*.f647.6%

                    \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
                6. Applied rewrites7.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{9 \cdot a - 3} \cdot \sqrt{9 \cdot a - 3}}} \]
                  16. lift--.f64N/A

                    \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{9 \cdot a - 3} \cdot \sqrt{9 \cdot a - 3}}} \]
                  17. sqrt-unprodN/A

                    \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{\left(9 \cdot a - 3\right) \cdot \left(9 \cdot a - 3\right)}}} \]
                  18. lower-sqrt.f64N/A

                    \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{\left(9 \cdot a - 3\right) \cdot \left(9 \cdot a - 3\right)}}} \]
                  19. lower-*.f6414.8%

                    \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{\sqrt{\left(9 \cdot a - 3\right) \cdot \left(9 \cdot a - 3\right)}}} \]
                8. Applied rewrites14.8%

                  \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{\sqrt{\mathsf{fma}\left(9, a, -3\right) \cdot \mathsf{fma}\left(9, a, -3\right)}}} \]

                if -3.2e-69 < a < 0.34999999999999998

                1. Initial program 25.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. Taylor expanded in a around inf

                  \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
                3. Step-by-step derivation
                  1. Applied rewrites18.0%

                    \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
                  2. Step-by-step derivation
                    1. lift--.f64N/A

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

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

                      \[\leadsto \left(a - \color{blue}{\frac{1}{3}}\right) \cdot 1 \]
                    4. flip--N/A

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

                      \[\leadsto \frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\color{blue}{\frac{1}{3} + a}} \cdot 1 \]
                    6. remove-sound-/N/A

                      \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
                    7. lower-/.f64N/A

                      \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
                    8. fp-cancel-sub-sign-invN/A

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

                      \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{3}} \cdot \frac{1}{3}}{\frac{1}{3} + a} \cdot 1 \]
                    10. metadata-evalN/A

                      \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{9}}}{\frac{1}{3} + a} \cdot 1 \]
                    11. metadata-evalN/A

                      \[\leadsto \frac{a \cdot a + \color{blue}{\frac{\frac{-1}{3}}{3}}}{\frac{1}{3} + a} \cdot 1 \]
                    12. metadata-evalN/A

                      \[\leadsto \frac{a \cdot a + \frac{\color{blue}{\mathsf{neg}\left(\frac{1}{3}\right)}}{3}}{\frac{1}{3} + a} \cdot 1 \]
                    13. lower-fma.f64N/A

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

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

                      \[\leadsto \frac{\mathsf{fma}\left(a, a, \color{blue}{\frac{-1}{9}}\right)}{\frac{1}{3} + a} \cdot 1 \]
                    16. +-commutativeN/A

                      \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a + \frac{1}{3}}} \cdot 1 \]
                    17. add-flipN/A

                      \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
                    18. lower--.f64N/A

                      \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
                    19. metadata-eval10.8%

                      \[\leadsto \frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{a - \color{blue}{-0.3333333333333333}} \cdot 1 \]
                  3. Applied rewrites10.8%

                    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{a - -0.3333333333333333}} \cdot 1 \]
                  4. Taylor expanded in a around inf

                    \[\leadsto \frac{\color{blue}{{a}^{2}}}{a - -0.3333333333333333} \cdot 1 \]
                  5. Step-by-step derivation
                    1. lower-pow.f6435.7%

                      \[\leadsto \frac{{a}^{\color{blue}{2}}}{a - -0.3333333333333333} \cdot 1 \]
                  6. Applied rewrites35.7%

                    \[\leadsto \frac{\color{blue}{{a}^{2}}}{a - -0.3333333333333333} \cdot 1 \]

                  if 0.34999999999999998 < a

                  1. Initial program 25.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(a - \frac{1}{3}\right) \cdot \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}, rand, a - \frac{1}{3}\right)} \]
                  3. Applied rewrites25.0%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)} \]
                4. Recombined 3 regimes into one program.
                5. Add Preprocessing

                Alternative 5: 37.7% accurate, 1.0× speedup?

                \[\begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{\sqrt{\mathsf{fma}\left(9, a, -3\right) \cdot \mathsf{fma}\left(9, a, -3\right)}}}\\ \mathbf{elif}\;a \leq 10000:\\ \;\;\;\;\frac{rand}{\sqrt{\frac{9}{a}}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)\\ \end{array} \]
                (FPCore (a rand)
                  :precision binary64
                  (if (<= a -2e-310)
                  (/
                   (* rand (- a 0.3333333333333333))
                   (sqrt (sqrt (* (fma 9.0 a -3.0) (fma 9.0 a -3.0)))))
                  (if (<= a 10000.0)
                    (/ rand (sqrt (/ 9.0 a)))
                    (fma
                     (/ (- a 0.3333333333333333) (sqrt (fma 9.0 a -3.0)))
                     rand
                     (- a 0.3333333333333333)))))
                double code(double a, double rand) {
                	double tmp;
                	if (a <= -2e-310) {
                		tmp = (rand * (a - 0.3333333333333333)) / sqrt(sqrt((fma(9.0, a, -3.0) * fma(9.0, a, -3.0))));
                	} else if (a <= 10000.0) {
                		tmp = rand / sqrt((9.0 / a));
                	} else {
                		tmp = fma(((a - 0.3333333333333333) / sqrt(fma(9.0, a, -3.0))), rand, (a - 0.3333333333333333));
                	}
                	return tmp;
                }
                
                function code(a, rand)
                	tmp = 0.0
                	if (a <= -2e-310)
                		tmp = Float64(Float64(rand * Float64(a - 0.3333333333333333)) / sqrt(sqrt(Float64(fma(9.0, a, -3.0) * fma(9.0, a, -3.0)))));
                	elseif (a <= 10000.0)
                		tmp = Float64(rand / sqrt(Float64(9.0 / a)));
                	else
                		tmp = fma(Float64(Float64(a - 0.3333333333333333) / sqrt(fma(9.0, a, -3.0))), rand, Float64(a - 0.3333333333333333));
                	end
                	return tmp
                end
                
                code[a_, rand_] := If[LessEqual[a, -2e-310], N[(N[(rand * N[(a - 0.3333333333333333), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sqrt[N[(N[(9.0 * a + -3.0), $MachinePrecision] * N[(9.0 * a + -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 10000.0], N[(rand / N[Sqrt[N[(9.0 / a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(a - 0.3333333333333333), $MachinePrecision] / N[Sqrt[N[(9.0 * a + -3.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * rand + N[(a - 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                \mathbf{if}\;a \leq -2 \cdot 10^{-310}:\\
                \;\;\;\;\frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{\sqrt{\mathsf{fma}\left(9, a, -3\right) \cdot \mathsf{fma}\left(9, a, -3\right)}}}\\
                
                \mathbf{elif}\;a \leq 10000:\\
                \;\;\;\;\frac{rand}{\sqrt{\frac{9}{a}}}\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)\\
                
                
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if a < -1.9999999999999939e-310

                  1. Initial program 25.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. lift-*.f64N/A

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

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                    3. lower-*.f6425.0%

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                  3. Applied rewrites25.0%

                    \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
                  4. Taylor expanded in rand around inf

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

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

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

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

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    6. lower-sqrt.f64N/A

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    8. lower-*.f647.6%

                      \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
                  6. Applied rewrites7.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{9 \cdot a - 3} \cdot \sqrt{9 \cdot a - 3}}} \]
                    16. lift--.f64N/A

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{9 \cdot a - 3} \cdot \sqrt{9 \cdot a - 3}}} \]
                    17. sqrt-unprodN/A

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{\left(9 \cdot a - 3\right) \cdot \left(9 \cdot a - 3\right)}}} \]
                    18. lower-sqrt.f64N/A

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{\sqrt{\left(9 \cdot a - 3\right) \cdot \left(9 \cdot a - 3\right)}}} \]
                    19. lower-*.f6414.8%

                      \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{\sqrt{\left(9 \cdot a - 3\right) \cdot \left(9 \cdot a - 3\right)}}} \]
                  8. Applied rewrites14.8%

                    \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{\sqrt{\mathsf{fma}\left(9, a, -3\right) \cdot \mathsf{fma}\left(9, a, -3\right)}}} \]

                  if -1.9999999999999939e-310 < a < 1e4

                  1. Initial program 25.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. lift-*.f64N/A

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

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                    3. lower-*.f6425.0%

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                  3. Applied rewrites25.0%

                    \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
                  4. Taylor expanded in rand around inf

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

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

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

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

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    6. lower-sqrt.f64N/A

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    8. lower-*.f647.6%

                      \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
                  6. Applied rewrites7.6%

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

                    \[\leadsto \frac{rand}{\color{blue}{\sqrt{\frac{9}{a}}}} \]
                  8. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                    2. lower-sqrt.f64N/A

                      \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                    3. lower-/.f6413.2%

                      \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                  9. Applied rewrites13.2%

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

                  if 1e4 < a

                  1. Initial program 25.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(a - \frac{1}{3}\right) \cdot \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}, rand, a - \frac{1}{3}\right)} \]
                  3. Applied rewrites25.0%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)} \]
                3. Recombined 3 regimes into one program.
                4. Add Preprocessing

                Alternative 6: 32.6% accurate, 1.1× speedup?

                \[\begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(0.3333333333333333, a, -0.1111111111111111\right) \cdot \frac{rand}{\sqrt{\left|0.3333333333333333 - a\right|}}\\ \mathbf{elif}\;a \leq 10000:\\ \;\;\;\;\frac{rand}{\sqrt{\frac{9}{a}}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)\\ \end{array} \]
                (FPCore (a rand)
                  :precision binary64
                  (if (<= a -2e-310)
                  (*
                   (fma 0.3333333333333333 a -0.1111111111111111)
                   (/ rand (sqrt (fabs (- 0.3333333333333333 a)))))
                  (if (<= a 10000.0)
                    (/ rand (sqrt (/ 9.0 a)))
                    (fma
                     (/ (- a 0.3333333333333333) (sqrt (fma 9.0 a -3.0)))
                     rand
                     (- a 0.3333333333333333)))))
                double code(double a, double rand) {
                	double tmp;
                	if (a <= -2e-310) {
                		tmp = fma(0.3333333333333333, a, -0.1111111111111111) * (rand / sqrt(fabs((0.3333333333333333 - a))));
                	} else if (a <= 10000.0) {
                		tmp = rand / sqrt((9.0 / a));
                	} else {
                		tmp = fma(((a - 0.3333333333333333) / sqrt(fma(9.0, a, -3.0))), rand, (a - 0.3333333333333333));
                	}
                	return tmp;
                }
                
                function code(a, rand)
                	tmp = 0.0
                	if (a <= -2e-310)
                		tmp = Float64(fma(0.3333333333333333, a, -0.1111111111111111) * Float64(rand / sqrt(abs(Float64(0.3333333333333333 - a)))));
                	elseif (a <= 10000.0)
                		tmp = Float64(rand / sqrt(Float64(9.0 / a)));
                	else
                		tmp = fma(Float64(Float64(a - 0.3333333333333333) / sqrt(fma(9.0, a, -3.0))), rand, Float64(a - 0.3333333333333333));
                	end
                	return tmp
                end
                
                code[a_, rand_] := If[LessEqual[a, -2e-310], N[(N[(0.3333333333333333 * a + -0.1111111111111111), $MachinePrecision] * N[(rand / N[Sqrt[N[Abs[N[(0.3333333333333333 - a), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 10000.0], N[(rand / N[Sqrt[N[(9.0 / a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(a - 0.3333333333333333), $MachinePrecision] / N[Sqrt[N[(9.0 * a + -3.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * rand + N[(a - 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                \mathbf{if}\;a \leq -2 \cdot 10^{-310}:\\
                \;\;\;\;\mathsf{fma}\left(0.3333333333333333, a, -0.1111111111111111\right) \cdot \frac{rand}{\sqrt{\left|0.3333333333333333 - a\right|}}\\
                
                \mathbf{elif}\;a \leq 10000:\\
                \;\;\;\;\frac{rand}{\sqrt{\frac{9}{a}}}\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)\\
                
                
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if a < -1.9999999999999939e-310

                  1. Initial program 25.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. lift-*.f64N/A

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

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                    3. lower-*.f6425.0%

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                  3. Applied rewrites25.0%

                    \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
                  4. Taylor expanded in rand around inf

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

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

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

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

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    6. lower-sqrt.f64N/A

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    8. lower-*.f647.6%

                      \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
                  6. Applied rewrites7.6%

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

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

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

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

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

                      \[\leadsto \frac{\left(a - \frac{1}{3}\right) \cdot rand}{\sqrt{9 \cdot a - 3}} \]
                    6. lift--.f64N/A

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

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

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

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

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

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

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

                      \[\leadsto \frac{\left(a - \frac{1}{3}\right) \cdot rand}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \]
                    14. sqrt-prodN/A

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

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

                      \[\leadsto \frac{\left(a - \frac{1}{3}\right) \cdot rand}{3 \cdot \sqrt{\color{blue}{\left|a - \frac{1}{3}\right|}}} \]
                    17. fabs-subN/A

                      \[\leadsto \frac{\left(a - \frac{1}{3}\right) \cdot rand}{3 \cdot \sqrt{\left|\frac{1}{3} - a\right|}} \]
                    18. frac-timesN/A

                      \[\leadsto \frac{a - \frac{1}{3}}{3} \cdot \color{blue}{\frac{rand}{\sqrt{\left|\frac{1}{3} - a\right|}}} \]
                    19. lower-*.f64N/A

                      \[\leadsto \frac{a - \frac{1}{3}}{3} \cdot \color{blue}{\frac{rand}{\sqrt{\left|\frac{1}{3} - a\right|}}} \]
                  8. Applied rewrites14.3%

                    \[\leadsto \mathsf{fma}\left(0.3333333333333333, a, -0.1111111111111111\right) \cdot \color{blue}{\frac{rand}{\sqrt{\left|0.3333333333333333 - a\right|}}} \]

                  if -1.9999999999999939e-310 < a < 1e4

                  1. Initial program 25.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. lift-*.f64N/A

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

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                    3. lower-*.f6425.0%

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                  3. Applied rewrites25.0%

                    \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
                  4. Taylor expanded in rand around inf

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

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

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

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

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    6. lower-sqrt.f64N/A

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    8. lower-*.f647.6%

                      \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
                  6. Applied rewrites7.6%

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

                    \[\leadsto \frac{rand}{\color{blue}{\sqrt{\frac{9}{a}}}} \]
                  8. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                    2. lower-sqrt.f64N/A

                      \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                    3. lower-/.f6413.2%

                      \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                  9. Applied rewrites13.2%

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

                  if 1e4 < a

                  1. Initial program 25.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(a - \frac{1}{3}\right) \cdot \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}, rand, a - \frac{1}{3}\right)} \]
                  3. Applied rewrites25.0%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)} \]
                3. Recombined 3 regimes into one program.
                4. Add Preprocessing

                Alternative 7: 32.6% accurate, 1.1× speedup?

                \[\begin{array}{l} t_0 := \sqrt{\left|0.3333333333333333 - a\right|}\\ \mathbf{if}\;a \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(0.3333333333333333, a, -0.1111111111111111\right) \cdot \frac{rand}{t\_0}\\ \mathbf{elif}\;a \leq 10000:\\ \;\;\;\;\frac{rand}{\sqrt{\frac{9}{a}}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-0.3333333333333333}{t\_0}, rand, -1\right) \cdot \left(0.3333333333333333 - a\right)\\ \end{array} \]
                (FPCore (a rand)
                  :precision binary64
                  (let* ((t_0 (sqrt (fabs (- 0.3333333333333333 a)))))
                  (if (<= a -2e-310)
                    (* (fma 0.3333333333333333 a -0.1111111111111111) (/ rand t_0))
                    (if (<= a 10000.0)
                      (/ rand (sqrt (/ 9.0 a)))
                      (*
                       (fma (/ -0.3333333333333333 t_0) rand -1.0)
                       (- 0.3333333333333333 a))))))
                double code(double a, double rand) {
                	double t_0 = sqrt(fabs((0.3333333333333333 - a)));
                	double tmp;
                	if (a <= -2e-310) {
                		tmp = fma(0.3333333333333333, a, -0.1111111111111111) * (rand / t_0);
                	} else if (a <= 10000.0) {
                		tmp = rand / sqrt((9.0 / a));
                	} else {
                		tmp = fma((-0.3333333333333333 / t_0), rand, -1.0) * (0.3333333333333333 - a);
                	}
                	return tmp;
                }
                
                function code(a, rand)
                	t_0 = sqrt(abs(Float64(0.3333333333333333 - a)))
                	tmp = 0.0
                	if (a <= -2e-310)
                		tmp = Float64(fma(0.3333333333333333, a, -0.1111111111111111) * Float64(rand / t_0));
                	elseif (a <= 10000.0)
                		tmp = Float64(rand / sqrt(Float64(9.0 / a)));
                	else
                		tmp = Float64(fma(Float64(-0.3333333333333333 / t_0), rand, -1.0) * Float64(0.3333333333333333 - a));
                	end
                	return tmp
                end
                
                code[a_, rand_] := Block[{t$95$0 = N[Sqrt[N[Abs[N[(0.3333333333333333 - a), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a, -2e-310], N[(N[(0.3333333333333333 * a + -0.1111111111111111), $MachinePrecision] * N[(rand / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 10000.0], N[(rand / N[Sqrt[N[(9.0 / a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.3333333333333333 / t$95$0), $MachinePrecision] * rand + -1.0), $MachinePrecision] * N[(0.3333333333333333 - a), $MachinePrecision]), $MachinePrecision]]]]
                
                \begin{array}{l}
                t_0 := \sqrt{\left|0.3333333333333333 - a\right|}\\
                \mathbf{if}\;a \leq -2 \cdot 10^{-310}:\\
                \;\;\;\;\mathsf{fma}\left(0.3333333333333333, a, -0.1111111111111111\right) \cdot \frac{rand}{t\_0}\\
                
                \mathbf{elif}\;a \leq 10000:\\
                \;\;\;\;\frac{rand}{\sqrt{\frac{9}{a}}}\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(\frac{-0.3333333333333333}{t\_0}, rand, -1\right) \cdot \left(0.3333333333333333 - a\right)\\
                
                
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if a < -1.9999999999999939e-310

                  1. Initial program 25.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. lift-*.f64N/A

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

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                    3. lower-*.f6425.0%

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                  3. Applied rewrites25.0%

                    \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
                  4. Taylor expanded in rand around inf

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

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

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

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

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    6. lower-sqrt.f64N/A

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    8. lower-*.f647.6%

                      \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
                  6. Applied rewrites7.6%

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

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

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

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

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

                      \[\leadsto \frac{\left(a - \frac{1}{3}\right) \cdot rand}{\sqrt{9 \cdot a - 3}} \]
                    6. lift--.f64N/A

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

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

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

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

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

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

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

                      \[\leadsto \frac{\left(a - \frac{1}{3}\right) \cdot rand}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \]
                    14. sqrt-prodN/A

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

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

                      \[\leadsto \frac{\left(a - \frac{1}{3}\right) \cdot rand}{3 \cdot \sqrt{\color{blue}{\left|a - \frac{1}{3}\right|}}} \]
                    17. fabs-subN/A

                      \[\leadsto \frac{\left(a - \frac{1}{3}\right) \cdot rand}{3 \cdot \sqrt{\left|\frac{1}{3} - a\right|}} \]
                    18. frac-timesN/A

                      \[\leadsto \frac{a - \frac{1}{3}}{3} \cdot \color{blue}{\frac{rand}{\sqrt{\left|\frac{1}{3} - a\right|}}} \]
                    19. lower-*.f64N/A

                      \[\leadsto \frac{a - \frac{1}{3}}{3} \cdot \color{blue}{\frac{rand}{\sqrt{\left|\frac{1}{3} - a\right|}}} \]
                  8. Applied rewrites14.3%

                    \[\leadsto \mathsf{fma}\left(0.3333333333333333, a, -0.1111111111111111\right) \cdot \color{blue}{\frac{rand}{\sqrt{\left|0.3333333333333333 - a\right|}}} \]

                  if -1.9999999999999939e-310 < a < 1e4

                  1. Initial program 25.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. lift-*.f64N/A

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

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                    3. lower-*.f6425.0%

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                  3. Applied rewrites25.0%

                    \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
                  4. Taylor expanded in rand around inf

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

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

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

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

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    6. lower-sqrt.f64N/A

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    8. lower-*.f647.6%

                      \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
                  6. Applied rewrites7.6%

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

                    \[\leadsto \frac{rand}{\color{blue}{\sqrt{\frac{9}{a}}}} \]
                  8. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                    2. lower-sqrt.f64N/A

                      \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                    3. lower-/.f6413.2%

                      \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                  9. Applied rewrites13.2%

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

                  if 1e4 < a

                  1. Initial program 25.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right)\right) - 1\right) \cdot \left(\frac{1}{3} - a\right)} \]
                  3. Applied rewrites26.9%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-0.3333333333333333}{\sqrt{\left|0.3333333333333333 - a\right|}}, rand, -1\right) \cdot \left(0.3333333333333333 - a\right)} \]
                3. Recombined 3 regimes into one program.
                4. Add Preprocessing

                Alternative 8: 32.6% accurate, 1.1× speedup?

                \[\begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(0.3333333333333333, a, -0.1111111111111111\right) \cdot \frac{rand}{\sqrt{\left|0.3333333333333333 - a\right|}}\\ \mathbf{elif}\;a \leq 10000:\\ \;\;\;\;\frac{rand}{\sqrt{\frac{9}{a}}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)\\ \end{array} \]
                (FPCore (a rand)
                  :precision binary64
                  (if (<= a -2e-310)
                  (*
                   (fma 0.3333333333333333 a -0.1111111111111111)
                   (/ rand (sqrt (fabs (- 0.3333333333333333 a)))))
                  (if (<= a 10000.0)
                    (/ rand (sqrt (/ 9.0 a)))
                    (*
                     (- (/ rand (sqrt (fma 9.0 a -3.0))) -1.0)
                     (- a 0.3333333333333333)))))
                double code(double a, double rand) {
                	double tmp;
                	if (a <= -2e-310) {
                		tmp = fma(0.3333333333333333, a, -0.1111111111111111) * (rand / sqrt(fabs((0.3333333333333333 - a))));
                	} else if (a <= 10000.0) {
                		tmp = rand / sqrt((9.0 / a));
                	} else {
                		tmp = ((rand / sqrt(fma(9.0, a, -3.0))) - -1.0) * (a - 0.3333333333333333);
                	}
                	return tmp;
                }
                
                function code(a, rand)
                	tmp = 0.0
                	if (a <= -2e-310)
                		tmp = Float64(fma(0.3333333333333333, a, -0.1111111111111111) * Float64(rand / sqrt(abs(Float64(0.3333333333333333 - a)))));
                	elseif (a <= 10000.0)
                		tmp = Float64(rand / sqrt(Float64(9.0 / a)));
                	else
                		tmp = Float64(Float64(Float64(rand / sqrt(fma(9.0, a, -3.0))) - -1.0) * Float64(a - 0.3333333333333333));
                	end
                	return tmp
                end
                
                code[a_, rand_] := If[LessEqual[a, -2e-310], N[(N[(0.3333333333333333 * a + -0.1111111111111111), $MachinePrecision] * N[(rand / N[Sqrt[N[Abs[N[(0.3333333333333333 - a), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 10000.0], N[(rand / N[Sqrt[N[(9.0 / a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(rand / N[Sqrt[N[(9.0 * a + -3.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision] * N[(a - 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                \mathbf{if}\;a \leq -2 \cdot 10^{-310}:\\
                \;\;\;\;\mathsf{fma}\left(0.3333333333333333, a, -0.1111111111111111\right) \cdot \frac{rand}{\sqrt{\left|0.3333333333333333 - a\right|}}\\
                
                \mathbf{elif}\;a \leq 10000:\\
                \;\;\;\;\frac{rand}{\sqrt{\frac{9}{a}}}\\
                
                \mathbf{else}:\\
                \;\;\;\;\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)\\
                
                
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if a < -1.9999999999999939e-310

                  1. Initial program 25.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. lift-*.f64N/A

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

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                    3. lower-*.f6425.0%

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                  3. Applied rewrites25.0%

                    \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
                  4. Taylor expanded in rand around inf

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

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

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

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

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    6. lower-sqrt.f64N/A

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    8. lower-*.f647.6%

                      \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
                  6. Applied rewrites7.6%

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

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

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

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

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

                      \[\leadsto \frac{\left(a - \frac{1}{3}\right) \cdot rand}{\sqrt{9 \cdot a - 3}} \]
                    6. lift--.f64N/A

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

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

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

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

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

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

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

                      \[\leadsto \frac{\left(a - \frac{1}{3}\right) \cdot rand}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \]
                    14. sqrt-prodN/A

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

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

                      \[\leadsto \frac{\left(a - \frac{1}{3}\right) \cdot rand}{3 \cdot \sqrt{\color{blue}{\left|a - \frac{1}{3}\right|}}} \]
                    17. fabs-subN/A

                      \[\leadsto \frac{\left(a - \frac{1}{3}\right) \cdot rand}{3 \cdot \sqrt{\left|\frac{1}{3} - a\right|}} \]
                    18. frac-timesN/A

                      \[\leadsto \frac{a - \frac{1}{3}}{3} \cdot \color{blue}{\frac{rand}{\sqrt{\left|\frac{1}{3} - a\right|}}} \]
                    19. lower-*.f64N/A

                      \[\leadsto \frac{a - \frac{1}{3}}{3} \cdot \color{blue}{\frac{rand}{\sqrt{\left|\frac{1}{3} - a\right|}}} \]
                  8. Applied rewrites14.3%

                    \[\leadsto \mathsf{fma}\left(0.3333333333333333, a, -0.1111111111111111\right) \cdot \color{blue}{\frac{rand}{\sqrt{\left|0.3333333333333333 - a\right|}}} \]

                  if -1.9999999999999939e-310 < a < 1e4

                  1. Initial program 25.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. lift-*.f64N/A

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

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                    3. lower-*.f6425.0%

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                  3. Applied rewrites25.0%

                    \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
                  4. Taylor expanded in rand around inf

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

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

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

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

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    6. lower-sqrt.f64N/A

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    8. lower-*.f647.6%

                      \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
                  6. Applied rewrites7.6%

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

                    \[\leadsto \frac{rand}{\color{blue}{\sqrt{\frac{9}{a}}}} \]
                  8. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                    2. lower-sqrt.f64N/A

                      \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                    3. lower-/.f6413.2%

                      \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                  9. Applied rewrites13.2%

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

                  if 1e4 < a

                  1. Initial program 25.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. lift-*.f64N/A

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

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                    3. lower-*.f6425.0%

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                  3. Applied rewrites25.0%

                    \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
                3. Recombined 3 regimes into one program.
                4. Add Preprocessing

                Alternative 9: 31.6% accurate, 1.4× speedup?

                \[\begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(0.3333333333333333, a, -0.1111111111111111\right) \cdot \frac{rand}{\sqrt{\left|0.3333333333333333 - a\right|}}\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{+26}:\\ \;\;\;\;\frac{rand}{\sqrt{\frac{9}{a}}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt{\frac{\left|a\right|}{9}}, rand, a - 0.3333333333333333\right)\\ \end{array} \]
                (FPCore (a rand)
                  :precision binary64
                  (if (<= a -2e-310)
                  (*
                   (fma 0.3333333333333333 a -0.1111111111111111)
                   (/ rand (sqrt (fabs (- 0.3333333333333333 a)))))
                  (if (<= a 3.2e+26)
                    (/ rand (sqrt (/ 9.0 a)))
                    (fma (sqrt (/ (fabs a) 9.0)) rand (- a 0.3333333333333333)))))
                double code(double a, double rand) {
                	double tmp;
                	if (a <= -2e-310) {
                		tmp = fma(0.3333333333333333, a, -0.1111111111111111) * (rand / sqrt(fabs((0.3333333333333333 - a))));
                	} else if (a <= 3.2e+26) {
                		tmp = rand / sqrt((9.0 / a));
                	} else {
                		tmp = fma(sqrt((fabs(a) / 9.0)), rand, (a - 0.3333333333333333));
                	}
                	return tmp;
                }
                
                function code(a, rand)
                	tmp = 0.0
                	if (a <= -2e-310)
                		tmp = Float64(fma(0.3333333333333333, a, -0.1111111111111111) * Float64(rand / sqrt(abs(Float64(0.3333333333333333 - a)))));
                	elseif (a <= 3.2e+26)
                		tmp = Float64(rand / sqrt(Float64(9.0 / a)));
                	else
                		tmp = fma(sqrt(Float64(abs(a) / 9.0)), rand, Float64(a - 0.3333333333333333));
                	end
                	return tmp
                end
                
                code[a_, rand_] := If[LessEqual[a, -2e-310], N[(N[(0.3333333333333333 * a + -0.1111111111111111), $MachinePrecision] * N[(rand / N[Sqrt[N[Abs[N[(0.3333333333333333 - a), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.2e+26], N[(rand / N[Sqrt[N[(9.0 / a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[Abs[a], $MachinePrecision] / 9.0), $MachinePrecision]], $MachinePrecision] * rand + N[(a - 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                \mathbf{if}\;a \leq -2 \cdot 10^{-310}:\\
                \;\;\;\;\mathsf{fma}\left(0.3333333333333333, a, -0.1111111111111111\right) \cdot \frac{rand}{\sqrt{\left|0.3333333333333333 - a\right|}}\\
                
                \mathbf{elif}\;a \leq 3.2 \cdot 10^{+26}:\\
                \;\;\;\;\frac{rand}{\sqrt{\frac{9}{a}}}\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(\sqrt{\frac{\left|a\right|}{9}}, rand, a - 0.3333333333333333\right)\\
                
                
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if a < -1.9999999999999939e-310

                  1. Initial program 25.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. lift-*.f64N/A

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

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                    3. lower-*.f6425.0%

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                  3. Applied rewrites25.0%

                    \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
                  4. Taylor expanded in rand around inf

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

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

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

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

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    6. lower-sqrt.f64N/A

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    8. lower-*.f647.6%

                      \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
                  6. Applied rewrites7.6%

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

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

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

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

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

                      \[\leadsto \frac{\left(a - \frac{1}{3}\right) \cdot rand}{\sqrt{9 \cdot a - 3}} \]
                    6. lift--.f64N/A

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

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

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

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

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

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

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

                      \[\leadsto \frac{\left(a - \frac{1}{3}\right) \cdot rand}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \]
                    14. sqrt-prodN/A

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

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

                      \[\leadsto \frac{\left(a - \frac{1}{3}\right) \cdot rand}{3 \cdot \sqrt{\color{blue}{\left|a - \frac{1}{3}\right|}}} \]
                    17. fabs-subN/A

                      \[\leadsto \frac{\left(a - \frac{1}{3}\right) \cdot rand}{3 \cdot \sqrt{\left|\frac{1}{3} - a\right|}} \]
                    18. frac-timesN/A

                      \[\leadsto \frac{a - \frac{1}{3}}{3} \cdot \color{blue}{\frac{rand}{\sqrt{\left|\frac{1}{3} - a\right|}}} \]
                    19. lower-*.f64N/A

                      \[\leadsto \frac{a - \frac{1}{3}}{3} \cdot \color{blue}{\frac{rand}{\sqrt{\left|\frac{1}{3} - a\right|}}} \]
                  8. Applied rewrites14.3%

                    \[\leadsto \mathsf{fma}\left(0.3333333333333333, a, -0.1111111111111111\right) \cdot \color{blue}{\frac{rand}{\sqrt{\left|0.3333333333333333 - a\right|}}} \]

                  if -1.9999999999999939e-310 < a < 3.2000000000000003e26

                  1. Initial program 25.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. lift-*.f64N/A

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

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                    3. lower-*.f6425.0%

                      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                  3. Applied rewrites25.0%

                    \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
                  4. Taylor expanded in rand around inf

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

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

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

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

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    6. lower-sqrt.f64N/A

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

                      \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                    8. lower-*.f647.6%

                      \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
                  6. Applied rewrites7.6%

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

                    \[\leadsto \frac{rand}{\color{blue}{\sqrt{\frac{9}{a}}}} \]
                  8. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                    2. lower-sqrt.f64N/A

                      \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                    3. lower-/.f6413.2%

                      \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                  9. Applied rewrites13.2%

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

                  if 3.2000000000000003e26 < a

                  1. Initial program 25.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(a - \frac{1}{3}\right) \cdot \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}, rand, a - \frac{1}{3}\right)} \]
                  3. Applied rewrites25.0%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)} \]
                  4. Taylor expanded in a around inf

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\sqrt{\frac{9}{a}}}}, rand, a - 0.3333333333333333\right) \]
                  5. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\sqrt{\frac{9}{a}}}}, rand, a - \frac{1}{3}\right) \]
                    2. lower-sqrt.f64N/A

                      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt{\frac{9}{a}}}, rand, a - \frac{1}{3}\right) \]
                    3. lower-/.f6425.5%

                      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt{\frac{9}{a}}}, rand, a - 0.3333333333333333\right) \]
                  6. Applied rewrites25.5%

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\sqrt{\frac{9}{a}}}}, rand, a - 0.3333333333333333\right) \]
                  7. Step-by-step derivation
                    1. lift-/.f64N/A

                      \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\sqrt{\frac{9}{a}}}}, rand, a - \frac{1}{3}\right) \]
                    2. lift-sqrt.f64N/A

                      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt{\frac{9}{a}}}, rand, a - \frac{1}{3}\right) \]
                    3. lift-/.f64N/A

                      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt{\frac{9}{a}}}, rand, a - \frac{1}{3}\right) \]
                    4. sqrt-divN/A

                      \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sqrt{\left|9\right|}}{\color{blue}{\sqrt{\left|a\right|}}}}, rand, a - \frac{1}{3}\right) \]
                    5. metadata-evalN/A

                      \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sqrt{9}}{\sqrt{\left|\color{blue}{a}\right|}}}, rand, a - \frac{1}{3}\right) \]
                    6. metadata-evalN/A

                      \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{3}{\sqrt{\color{blue}{\left|a\right|}}}}, rand, a - \frac{1}{3}\right) \]
                    7. div-flip-revN/A

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

                      \[\leadsto \mathsf{fma}\left(\frac{\sqrt{\left|a\right|}}{\sqrt{9}}, rand, a - \frac{1}{3}\right) \]
                    9. sqrt-undivN/A

                      \[\leadsto \mathsf{fma}\left(\sqrt{\frac{\left|a\right|}{9}}, rand, a - \frac{1}{3}\right) \]
                    10. lower-sqrt.f64N/A

                      \[\leadsto \mathsf{fma}\left(\sqrt{\frac{\left|a\right|}{9}}, rand, a - \frac{1}{3}\right) \]
                    11. lower-/.f64N/A

                      \[\leadsto \mathsf{fma}\left(\sqrt{\frac{\left|a\right|}{9}}, rand, a - \frac{1}{3}\right) \]
                    12. lower-fabs.f6426.7%

                      \[\leadsto \mathsf{fma}\left(\sqrt{\frac{\left|a\right|}{9}}, rand, a - 0.3333333333333333\right) \]
                  8. Applied rewrites26.7%

                    \[\leadsto \mathsf{fma}\left(\sqrt{\frac{\left|a\right|}{9}}, rand, a - 0.3333333333333333\right) \]
                3. Recombined 3 regimes into one program.
                4. Add Preprocessing

                Alternative 10: 29.7% accurate, 1.4× speedup?

                \[\begin{array}{l} \mathbf{if}\;a \leq 2.05 \cdot 10^{-305}:\\ \;\;\;\;\frac{-0.1111111111111111}{a - -0.3333333333333333} \cdot 1\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{+26}:\\ \;\;\;\;\frac{rand}{\sqrt{\frac{9}{a}}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt{\frac{\left|a\right|}{9}}, rand, a - 0.3333333333333333\right)\\ \end{array} \]
                (FPCore (a rand)
                  :precision binary64
                  (if (<= a 2.05e-305)
                  (* (/ -0.1111111111111111 (- a -0.3333333333333333)) 1.0)
                  (if (<= a 3.2e+26)
                    (/ rand (sqrt (/ 9.0 a)))
                    (fma (sqrt (/ (fabs a) 9.0)) rand (- a 0.3333333333333333)))))
                double code(double a, double rand) {
                	double tmp;
                	if (a <= 2.05e-305) {
                		tmp = (-0.1111111111111111 / (a - -0.3333333333333333)) * 1.0;
                	} else if (a <= 3.2e+26) {
                		tmp = rand / sqrt((9.0 / a));
                	} else {
                		tmp = fma(sqrt((fabs(a) / 9.0)), rand, (a - 0.3333333333333333));
                	}
                	return tmp;
                }
                
                function code(a, rand)
                	tmp = 0.0
                	if (a <= 2.05e-305)
                		tmp = Float64(Float64(-0.1111111111111111 / Float64(a - -0.3333333333333333)) * 1.0);
                	elseif (a <= 3.2e+26)
                		tmp = Float64(rand / sqrt(Float64(9.0 / a)));
                	else
                		tmp = fma(sqrt(Float64(abs(a) / 9.0)), rand, Float64(a - 0.3333333333333333));
                	end
                	return tmp
                end
                
                code[a_, rand_] := If[LessEqual[a, 2.05e-305], N[(N[(-0.1111111111111111 / N[(a - -0.3333333333333333), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[a, 3.2e+26], N[(rand / N[Sqrt[N[(9.0 / a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[Abs[a], $MachinePrecision] / 9.0), $MachinePrecision]], $MachinePrecision] * rand + N[(a - 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                \mathbf{if}\;a \leq 2.05 \cdot 10^{-305}:\\
                \;\;\;\;\frac{-0.1111111111111111}{a - -0.3333333333333333} \cdot 1\\
                
                \mathbf{elif}\;a \leq 3.2 \cdot 10^{+26}:\\
                \;\;\;\;\frac{rand}{\sqrt{\frac{9}{a}}}\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(\sqrt{\frac{\left|a\right|}{9}}, rand, a - 0.3333333333333333\right)\\
                
                
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if a < 2.0500000000000001e-305

                  1. Initial program 25.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. Taylor expanded in a around inf

                    \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
                  3. Step-by-step derivation
                    1. Applied rewrites18.0%

                      \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
                    2. Step-by-step derivation
                      1. lift--.f64N/A

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

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

                        \[\leadsto \left(a - \color{blue}{\frac{1}{3}}\right) \cdot 1 \]
                      4. flip--N/A

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

                        \[\leadsto \frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\color{blue}{\frac{1}{3} + a}} \cdot 1 \]
                      6. remove-sound-/N/A

                        \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
                      7. lower-/.f64N/A

                        \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
                      8. fp-cancel-sub-sign-invN/A

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

                        \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{3}} \cdot \frac{1}{3}}{\frac{1}{3} + a} \cdot 1 \]
                      10. metadata-evalN/A

                        \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{9}}}{\frac{1}{3} + a} \cdot 1 \]
                      11. metadata-evalN/A

                        \[\leadsto \frac{a \cdot a + \color{blue}{\frac{\frac{-1}{3}}{3}}}{\frac{1}{3} + a} \cdot 1 \]
                      12. metadata-evalN/A

                        \[\leadsto \frac{a \cdot a + \frac{\color{blue}{\mathsf{neg}\left(\frac{1}{3}\right)}}{3}}{\frac{1}{3} + a} \cdot 1 \]
                      13. lower-fma.f64N/A

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

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

                        \[\leadsto \frac{\mathsf{fma}\left(a, a, \color{blue}{\frac{-1}{9}}\right)}{\frac{1}{3} + a} \cdot 1 \]
                      16. +-commutativeN/A

                        \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a + \frac{1}{3}}} \cdot 1 \]
                      17. add-flipN/A

                        \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
                      18. lower--.f64N/A

                        \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
                      19. metadata-eval10.8%

                        \[\leadsto \frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{a - \color{blue}{-0.3333333333333333}} \cdot 1 \]
                    3. Applied rewrites10.8%

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

                      \[\leadsto \frac{\color{blue}{\frac{-1}{9}}}{a - -0.3333333333333333} \cdot 1 \]
                    5. Step-by-step derivation
                      1. Applied rewrites3.3%

                        \[\leadsto \frac{\color{blue}{-0.1111111111111111}}{a - -0.3333333333333333} \cdot 1 \]

                      if 2.0500000000000001e-305 < a < 3.2000000000000003e26

                      1. Initial program 25.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. lift-*.f64N/A

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

                          \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                        3. lower-*.f6425.0%

                          \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                      3. Applied rewrites25.0%

                        \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
                      4. Taylor expanded in rand around inf

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

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

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

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

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

                          \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                        6. lower-sqrt.f64N/A

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

                          \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                        8. lower-*.f647.6%

                          \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
                      6. Applied rewrites7.6%

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

                        \[\leadsto \frac{rand}{\color{blue}{\sqrt{\frac{9}{a}}}} \]
                      8. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                        2. lower-sqrt.f64N/A

                          \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                        3. lower-/.f6413.2%

                          \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                      9. Applied rewrites13.2%

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

                      if 3.2000000000000003e26 < a

                      1. Initial program 25.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\left(a - \frac{1}{3}\right) \cdot \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}, rand, a - \frac{1}{3}\right)} \]
                      3. Applied rewrites25.0%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)} \]
                      4. Taylor expanded in a around inf

                        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\sqrt{\frac{9}{a}}}}, rand, a - 0.3333333333333333\right) \]
                      5. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\sqrt{\frac{9}{a}}}}, rand, a - \frac{1}{3}\right) \]
                        2. lower-sqrt.f64N/A

                          \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt{\frac{9}{a}}}, rand, a - \frac{1}{3}\right) \]
                        3. lower-/.f6425.5%

                          \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt{\frac{9}{a}}}, rand, a - 0.3333333333333333\right) \]
                      6. Applied rewrites25.5%

                        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\sqrt{\frac{9}{a}}}}, rand, a - 0.3333333333333333\right) \]
                      7. Step-by-step derivation
                        1. lift-/.f64N/A

                          \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\sqrt{\frac{9}{a}}}}, rand, a - \frac{1}{3}\right) \]
                        2. lift-sqrt.f64N/A

                          \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt{\frac{9}{a}}}, rand, a - \frac{1}{3}\right) \]
                        3. lift-/.f64N/A

                          \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt{\frac{9}{a}}}, rand, a - \frac{1}{3}\right) \]
                        4. sqrt-divN/A

                          \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sqrt{\left|9\right|}}{\color{blue}{\sqrt{\left|a\right|}}}}, rand, a - \frac{1}{3}\right) \]
                        5. metadata-evalN/A

                          \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sqrt{9}}{\sqrt{\left|\color{blue}{a}\right|}}}, rand, a - \frac{1}{3}\right) \]
                        6. metadata-evalN/A

                          \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{3}{\sqrt{\color{blue}{\left|a\right|}}}}, rand, a - \frac{1}{3}\right) \]
                        7. div-flip-revN/A

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

                          \[\leadsto \mathsf{fma}\left(\frac{\sqrt{\left|a\right|}}{\sqrt{9}}, rand, a - \frac{1}{3}\right) \]
                        9. sqrt-undivN/A

                          \[\leadsto \mathsf{fma}\left(\sqrt{\frac{\left|a\right|}{9}}, rand, a - \frac{1}{3}\right) \]
                        10. lower-sqrt.f64N/A

                          \[\leadsto \mathsf{fma}\left(\sqrt{\frac{\left|a\right|}{9}}, rand, a - \frac{1}{3}\right) \]
                        11. lower-/.f64N/A

                          \[\leadsto \mathsf{fma}\left(\sqrt{\frac{\left|a\right|}{9}}, rand, a - \frac{1}{3}\right) \]
                        12. lower-fabs.f6426.7%

                          \[\leadsto \mathsf{fma}\left(\sqrt{\frac{\left|a\right|}{9}}, rand, a - 0.3333333333333333\right) \]
                      8. Applied rewrites26.7%

                        \[\leadsto \mathsf{fma}\left(\sqrt{\frac{\left|a\right|}{9}}, rand, a - 0.3333333333333333\right) \]
                    6. Recombined 3 regimes into one program.
                    7. Add Preprocessing

                    Alternative 11: 29.7% accurate, 1.4× speedup?

                    \[\begin{array}{l} \mathbf{if}\;a \leq 2.05 \cdot 10^{-305}:\\ \;\;\;\;\frac{-0.1111111111111111}{a - -0.3333333333333333} \cdot 1\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{+26}:\\ \;\;\;\;\frac{rand}{\sqrt{\frac{9}{a}}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.3333333333333333 \cdot \sqrt{\left|a\right|}, rand, a - 0.3333333333333333\right)\\ \end{array} \]
                    (FPCore (a rand)
                      :precision binary64
                      (if (<= a 2.05e-305)
                      (* (/ -0.1111111111111111 (- a -0.3333333333333333)) 1.0)
                      (if (<= a 3.2e+26)
                        (/ rand (sqrt (/ 9.0 a)))
                        (fma
                         (* 0.3333333333333333 (sqrt (fabs a)))
                         rand
                         (- a 0.3333333333333333)))))
                    double code(double a, double rand) {
                    	double tmp;
                    	if (a <= 2.05e-305) {
                    		tmp = (-0.1111111111111111 / (a - -0.3333333333333333)) * 1.0;
                    	} else if (a <= 3.2e+26) {
                    		tmp = rand / sqrt((9.0 / a));
                    	} else {
                    		tmp = fma((0.3333333333333333 * sqrt(fabs(a))), rand, (a - 0.3333333333333333));
                    	}
                    	return tmp;
                    }
                    
                    function code(a, rand)
                    	tmp = 0.0
                    	if (a <= 2.05e-305)
                    		tmp = Float64(Float64(-0.1111111111111111 / Float64(a - -0.3333333333333333)) * 1.0);
                    	elseif (a <= 3.2e+26)
                    		tmp = Float64(rand / sqrt(Float64(9.0 / a)));
                    	else
                    		tmp = fma(Float64(0.3333333333333333 * sqrt(abs(a))), rand, Float64(a - 0.3333333333333333));
                    	end
                    	return tmp
                    end
                    
                    code[a_, rand_] := If[LessEqual[a, 2.05e-305], N[(N[(-0.1111111111111111 / N[(a - -0.3333333333333333), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[a, 3.2e+26], N[(rand / N[Sqrt[N[(9.0 / a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 * N[Sqrt[N[Abs[a], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * rand + N[(a - 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    \mathbf{if}\;a \leq 2.05 \cdot 10^{-305}:\\
                    \;\;\;\;\frac{-0.1111111111111111}{a - -0.3333333333333333} \cdot 1\\
                    
                    \mathbf{elif}\;a \leq 3.2 \cdot 10^{+26}:\\
                    \;\;\;\;\frac{rand}{\sqrt{\frac{9}{a}}}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\mathsf{fma}\left(0.3333333333333333 \cdot \sqrt{\left|a\right|}, rand, a - 0.3333333333333333\right)\\
                    
                    
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if a < 2.0500000000000001e-305

                      1. Initial program 25.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. Taylor expanded in a around inf

                        \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
                      3. Step-by-step derivation
                        1. Applied rewrites18.0%

                          \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
                        2. Step-by-step derivation
                          1. lift--.f64N/A

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

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

                            \[\leadsto \left(a - \color{blue}{\frac{1}{3}}\right) \cdot 1 \]
                          4. flip--N/A

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

                            \[\leadsto \frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\color{blue}{\frac{1}{3} + a}} \cdot 1 \]
                          6. remove-sound-/N/A

                            \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
                          7. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{a \cdot a - \frac{1}{3} \cdot \frac{1}{3}}{\frac{1}{3} + a}} \cdot 1 \]
                          8. fp-cancel-sub-sign-invN/A

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

                            \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{3}} \cdot \frac{1}{3}}{\frac{1}{3} + a} \cdot 1 \]
                          10. metadata-evalN/A

                            \[\leadsto \frac{a \cdot a + \color{blue}{\frac{-1}{9}}}{\frac{1}{3} + a} \cdot 1 \]
                          11. metadata-evalN/A

                            \[\leadsto \frac{a \cdot a + \color{blue}{\frac{\frac{-1}{3}}{3}}}{\frac{1}{3} + a} \cdot 1 \]
                          12. metadata-evalN/A

                            \[\leadsto \frac{a \cdot a + \frac{\color{blue}{\mathsf{neg}\left(\frac{1}{3}\right)}}{3}}{\frac{1}{3} + a} \cdot 1 \]
                          13. lower-fma.f64N/A

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

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

                            \[\leadsto \frac{\mathsf{fma}\left(a, a, \color{blue}{\frac{-1}{9}}\right)}{\frac{1}{3} + a} \cdot 1 \]
                          16. +-commutativeN/A

                            \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a + \frac{1}{3}}} \cdot 1 \]
                          17. add-flipN/A

                            \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
                          18. lower--.f64N/A

                            \[\leadsto \frac{\mathsf{fma}\left(a, a, \frac{-1}{9}\right)}{\color{blue}{a - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}} \cdot 1 \]
                          19. metadata-eval10.8%

                            \[\leadsto \frac{\mathsf{fma}\left(a, a, -0.1111111111111111\right)}{a - \color{blue}{-0.3333333333333333}} \cdot 1 \]
                        3. Applied rewrites10.8%

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

                          \[\leadsto \frac{\color{blue}{\frac{-1}{9}}}{a - -0.3333333333333333} \cdot 1 \]
                        5. Step-by-step derivation
                          1. Applied rewrites3.3%

                            \[\leadsto \frac{\color{blue}{-0.1111111111111111}}{a - -0.3333333333333333} \cdot 1 \]

                          if 2.0500000000000001e-305 < a < 3.2000000000000003e26

                          1. Initial program 25.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. lift-*.f64N/A

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

                              \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                            3. lower-*.f6425.0%

                              \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                          3. Applied rewrites25.0%

                            \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
                          4. Taylor expanded in rand around inf

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

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

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

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

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

                              \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                            6. lower-sqrt.f64N/A

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

                              \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                            8. lower-*.f647.6%

                              \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
                          6. Applied rewrites7.6%

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

                            \[\leadsto \frac{rand}{\color{blue}{\sqrt{\frac{9}{a}}}} \]
                          8. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                            2. lower-sqrt.f64N/A

                              \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                            3. lower-/.f6413.2%

                              \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                          9. Applied rewrites13.2%

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

                          if 3.2000000000000003e26 < a

                          1. Initial program 25.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(\left(a - \frac{1}{3}\right) \cdot \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}}, rand, a - \frac{1}{3}\right)} \]
                          3. Applied rewrites25.0%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{a - 0.3333333333333333}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}}, rand, a - 0.3333333333333333\right)} \]
                          4. Taylor expanded in a around inf

                            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\sqrt{\frac{9}{a}}}}, rand, a - 0.3333333333333333\right) \]
                          5. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\sqrt{\frac{9}{a}}}}, rand, a - \frac{1}{3}\right) \]
                            2. lower-sqrt.f64N/A

                              \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt{\frac{9}{a}}}, rand, a - \frac{1}{3}\right) \]
                            3. lower-/.f6425.5%

                              \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt{\frac{9}{a}}}, rand, a - 0.3333333333333333\right) \]
                          6. Applied rewrites25.5%

                            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\sqrt{\frac{9}{a}}}}, rand, a - 0.3333333333333333\right) \]
                          7. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\sqrt{\frac{9}{a}}}}, rand, a - \frac{1}{3}\right) \]
                            2. lift-sqrt.f64N/A

                              \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt{\frac{9}{a}}}, rand, a - \frac{1}{3}\right) \]
                            3. lift-/.f64N/A

                              \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt{\frac{9}{a}}}, rand, a - \frac{1}{3}\right) \]
                            4. sqrt-divN/A

                              \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sqrt{\left|9\right|}}{\color{blue}{\sqrt{\left|a\right|}}}}, rand, a - \frac{1}{3}\right) \]
                            5. metadata-evalN/A

                              \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\sqrt{9}}{\sqrt{\left|\color{blue}{a}\right|}}}, rand, a - \frac{1}{3}\right) \]
                            6. metadata-evalN/A

                              \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{3}{\sqrt{\color{blue}{\left|a\right|}}}}, rand, a - \frac{1}{3}\right) \]
                            7. associate-/r/N/A

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

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

                              \[\leadsto \mathsf{fma}\left(\frac{1}{3} \cdot \color{blue}{\sqrt{\left|a\right|}}, rand, a - \frac{1}{3}\right) \]
                            10. lower-sqrt.f64N/A

                              \[\leadsto \mathsf{fma}\left(\frac{1}{3} \cdot \sqrt{\left|a\right|}, rand, a - \frac{1}{3}\right) \]
                            11. lower-fabs.f6426.7%

                              \[\leadsto \mathsf{fma}\left(0.3333333333333333 \cdot \sqrt{\left|a\right|}, rand, a - 0.3333333333333333\right) \]
                          8. Applied rewrites26.7%

                            \[\leadsto \mathsf{fma}\left(0.3333333333333333 \cdot \color{blue}{\sqrt{\left|a\right|}}, rand, a - 0.3333333333333333\right) \]
                        6. Recombined 3 regimes into one program.
                        7. Add Preprocessing

                        Alternative 12: 24.8% accurate, 1.7× speedup?

                        \[\begin{array}{l} t_0 := \frac{rand}{\sqrt{\frac{9}{a}}}\\ \mathbf{if}\;rand \leq -8.9 \cdot 10^{+46}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;rand \leq 4.2 \cdot 10^{+56}:\\ \;\;\;\;\left(a \cdot 1\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                        (FPCore (a rand)
                          :precision binary64
                          (let* ((t_0 (/ rand (sqrt (/ 9.0 a)))))
                          (if (<= rand -8.9e+46)
                            t_0
                            (if (<= rand 4.2e+56) (* (* a 1.0) 1.0) t_0))))
                        double code(double a, double rand) {
                        	double t_0 = rand / sqrt((9.0 / a));
                        	double tmp;
                        	if (rand <= -8.9e+46) {
                        		tmp = t_0;
                        	} else if (rand <= 4.2e+56) {
                        		tmp = (a * 1.0) * 1.0;
                        	} else {
                        		tmp = t_0;
                        	}
                        	return tmp;
                        }
                        
                        real(8) function code(a, rand)
                        use fmin_fmax_functions
                            real(8), intent (in) :: a
                            real(8), intent (in) :: rand
                            real(8) :: t_0
                            real(8) :: tmp
                            t_0 = rand / sqrt((9.0d0 / a))
                            if (rand <= (-8.9d+46)) then
                                tmp = t_0
                            else if (rand <= 4.2d+56) then
                                tmp = (a * 1.0d0) * 1.0d0
                            else
                                tmp = t_0
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double a, double rand) {
                        	double t_0 = rand / Math.sqrt((9.0 / a));
                        	double tmp;
                        	if (rand <= -8.9e+46) {
                        		tmp = t_0;
                        	} else if (rand <= 4.2e+56) {
                        		tmp = (a * 1.0) * 1.0;
                        	} else {
                        		tmp = t_0;
                        	}
                        	return tmp;
                        }
                        
                        def code(a, rand):
                        	t_0 = rand / math.sqrt((9.0 / a))
                        	tmp = 0
                        	if rand <= -8.9e+46:
                        		tmp = t_0
                        	elif rand <= 4.2e+56:
                        		tmp = (a * 1.0) * 1.0
                        	else:
                        		tmp = t_0
                        	return tmp
                        
                        function code(a, rand)
                        	t_0 = Float64(rand / sqrt(Float64(9.0 / a)))
                        	tmp = 0.0
                        	if (rand <= -8.9e+46)
                        		tmp = t_0;
                        	elseif (rand <= 4.2e+56)
                        		tmp = Float64(Float64(a * 1.0) * 1.0);
                        	else
                        		tmp = t_0;
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(a, rand)
                        	t_0 = rand / sqrt((9.0 / a));
                        	tmp = 0.0;
                        	if (rand <= -8.9e+46)
                        		tmp = t_0;
                        	elseif (rand <= 4.2e+56)
                        		tmp = (a * 1.0) * 1.0;
                        	else
                        		tmp = t_0;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[a_, rand_] := Block[{t$95$0 = N[(rand / N[Sqrt[N[(9.0 / a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -8.9e+46], t$95$0, If[LessEqual[rand, 4.2e+56], N[(N[(a * 1.0), $MachinePrecision] * 1.0), $MachinePrecision], t$95$0]]]
                        
                        \begin{array}{l}
                        t_0 := \frac{rand}{\sqrt{\frac{9}{a}}}\\
                        \mathbf{if}\;rand \leq -8.9 \cdot 10^{+46}:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{elif}\;rand \leq 4.2 \cdot 10^{+56}:\\
                        \;\;\;\;\left(a \cdot 1\right) \cdot 1\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_0\\
                        
                        
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if rand < -8.8999999999999997e46 or 4.2000000000000003e56 < rand

                          1. Initial program 25.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. lift-*.f64N/A

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

                              \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                            3. lower-*.f6425.0%

                              \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1}{3}\right)}} \cdot rand\right) \cdot \left(a - \frac{1}{3}\right)} \]
                          3. Applied rewrites25.0%

                            \[\leadsto \color{blue}{\left(\frac{rand}{\sqrt{\mathsf{fma}\left(9, a, -3\right)}} - -1\right) \cdot \left(a - 0.3333333333333333\right)} \]
                          4. Taylor expanded in rand around inf

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

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

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

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

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

                              \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                            6. lower-sqrt.f64N/A

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

                              \[\leadsto \frac{rand \cdot \left(a - \frac{1}{3}\right)}{\sqrt{9 \cdot a - 3}} \]
                            8. lower-*.f647.6%

                              \[\leadsto \frac{rand \cdot \left(a - 0.3333333333333333\right)}{\sqrt{9 \cdot a - 3}} \]
                          6. Applied rewrites7.6%

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

                            \[\leadsto \frac{rand}{\color{blue}{\sqrt{\frac{9}{a}}}} \]
                          8. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                            2. lower-sqrt.f64N/A

                              \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                            3. lower-/.f6413.2%

                              \[\leadsto \frac{rand}{\sqrt{\frac{9}{a}}} \]
                          9. Applied rewrites13.2%

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

                          if -8.8999999999999997e46 < rand < 4.2000000000000003e56

                          1. Initial program 25.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. Taylor expanded in a around inf

                            \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
                          3. Step-by-step derivation
                            1. Applied rewrites18.0%

                              \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
                            2. Taylor expanded in a around inf

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

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

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

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

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

                                \[\leadsto \left(a \cdot \left(1 - \frac{1}{3} \cdot \frac{\color{blue}{1}}{a}\right)\right) \cdot 1 \]
                              6. lower-/.f6418.0%

                                \[\leadsto \left(a \cdot \left(1 - 0.3333333333333333 \cdot \frac{1}{\color{blue}{a}}\right)\right) \cdot 1 \]
                            4. Applied rewrites18.0%

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

                              \[\leadsto \left(a \cdot 1\right) \cdot 1 \]
                            6. Step-by-step derivation
                              1. Applied rewrites18.9%

                                \[\leadsto \left(a \cdot 1\right) \cdot 1 \]
                            7. Recombined 2 regimes into one program.
                            8. Add Preprocessing

                            Alternative 13: 18.9% accurate, 4.5× speedup?

                            \[\left(a \cdot 1\right) \cdot 1 \]
                            (FPCore (a rand)
                              :precision binary64
                              (* (* a 1.0) 1.0))
                            double code(double a, double rand) {
                            	return (a * 1.0) * 1.0;
                            }
                            
                            real(8) function code(a, rand)
                            use fmin_fmax_functions
                                real(8), intent (in) :: a
                                real(8), intent (in) :: rand
                                code = (a * 1.0d0) * 1.0d0
                            end function
                            
                            public static double code(double a, double rand) {
                            	return (a * 1.0) * 1.0;
                            }
                            
                            def code(a, rand):
                            	return (a * 1.0) * 1.0
                            
                            function code(a, rand)
                            	return Float64(Float64(a * 1.0) * 1.0)
                            end
                            
                            function tmp = code(a, rand)
                            	tmp = (a * 1.0) * 1.0;
                            end
                            
                            code[a_, rand_] := N[(N[(a * 1.0), $MachinePrecision] * 1.0), $MachinePrecision]
                            
                            \left(a \cdot 1\right) \cdot 1
                            
                            Derivation
                            1. Initial program 25.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. Taylor expanded in a around inf

                              \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
                            3. Step-by-step derivation
                              1. Applied rewrites18.0%

                                \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
                              2. Taylor expanded in a around inf

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

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

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

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

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

                                  \[\leadsto \left(a \cdot \left(1 - \frac{1}{3} \cdot \frac{\color{blue}{1}}{a}\right)\right) \cdot 1 \]
                                6. lower-/.f6418.0%

                                  \[\leadsto \left(a \cdot \left(1 - 0.3333333333333333 \cdot \frac{1}{\color{blue}{a}}\right)\right) \cdot 1 \]
                              4. Applied rewrites18.0%

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

                                \[\leadsto \left(a \cdot 1\right) \cdot 1 \]
                              6. Step-by-step derivation
                                1. Applied rewrites18.9%

                                  \[\leadsto \left(a \cdot 1\right) \cdot 1 \]
                                2. Add Preprocessing

                                Alternative 14: 18.0% accurate, 4.7× speedup?

                                \[\left(a - 0.3333333333333333\right) \cdot 1 \]
                                (FPCore (a rand)
                                  :precision binary64
                                  (* (- a 0.3333333333333333) 1.0))
                                double code(double a, double rand) {
                                	return (a - 0.3333333333333333) * 1.0;
                                }
                                
                                real(8) function code(a, rand)
                                use fmin_fmax_functions
                                    real(8), intent (in) :: a
                                    real(8), intent (in) :: rand
                                    code = (a - 0.3333333333333333d0) * 1.0d0
                                end function
                                
                                public static double code(double a, double rand) {
                                	return (a - 0.3333333333333333) * 1.0;
                                }
                                
                                def code(a, rand):
                                	return (a - 0.3333333333333333) * 1.0
                                
                                function code(a, rand)
                                	return Float64(Float64(a - 0.3333333333333333) * 1.0)
                                end
                                
                                function tmp = code(a, rand)
                                	tmp = (a - 0.3333333333333333) * 1.0;
                                end
                                
                                code[a_, rand_] := N[(N[(a - 0.3333333333333333), $MachinePrecision] * 1.0), $MachinePrecision]
                                
                                \left(a - 0.3333333333333333\right) \cdot 1
                                
                                Derivation
                                1. Initial program 25.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. Taylor expanded in a around inf

                                  \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
                                3. Step-by-step derivation
                                  1. Applied rewrites18.0%

                                    \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
                                  2. Step-by-step derivation
                                    1. lift-/.f64N/A

                                      \[\leadsto \left(a - \color{blue}{\frac{1}{3}}\right) \cdot 1 \]
                                    2. metadata-eval18.0%

                                      \[\leadsto \left(a - \color{blue}{0.3333333333333333}\right) \cdot 1 \]
                                  3. Applied rewrites18.0%

                                    \[\leadsto \left(a - \color{blue}{0.3333333333333333}\right) \cdot 1 \]
                                  4. Add Preprocessing

                                  Alternative 15: 2.7% accurate, 7.8× speedup?

                                  \[-0.3333333333333333 \cdot 1 \]
                                  (FPCore (a rand)
                                    :precision binary64
                                    (* -0.3333333333333333 1.0))
                                  double code(double a, double rand) {
                                  	return -0.3333333333333333 * 1.0;
                                  }
                                  
                                  real(8) function code(a, rand)
                                  use fmin_fmax_functions
                                      real(8), intent (in) :: a
                                      real(8), intent (in) :: rand
                                      code = (-0.3333333333333333d0) * 1.0d0
                                  end function
                                  
                                  public static double code(double a, double rand) {
                                  	return -0.3333333333333333 * 1.0;
                                  }
                                  
                                  def code(a, rand):
                                  	return -0.3333333333333333 * 1.0
                                  
                                  function code(a, rand)
                                  	return Float64(-0.3333333333333333 * 1.0)
                                  end
                                  
                                  function tmp = code(a, rand)
                                  	tmp = -0.3333333333333333 * 1.0;
                                  end
                                  
                                  code[a_, rand_] := N[(-0.3333333333333333 * 1.0), $MachinePrecision]
                                  
                                  -0.3333333333333333 \cdot 1
                                  
                                  Derivation
                                  1. Initial program 25.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. Taylor expanded in a around inf

                                    \[\leadsto \left(a - \frac{1}{3}\right) \cdot \color{blue}{1} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites18.0%

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

                                      \[\leadsto \color{blue}{\frac{-1}{3}} \cdot 1 \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites2.7%

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

                                      Reproduce

                                      ?
                                      herbie shell --seed 2025313 -o setup:search
                                      (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))))