
(FPCore (a rand) :precision binary64 (let* ((t_0 (- a (/ 1.0 3.0)))) (* t_0 (+ 1.0 (* (/ 1.0 (sqrt (* 9.0 t_0))) rand)))))
double code(double a, double rand) {
double t_0 = a - (1.0 / 3.0);
return t_0 * (1.0 + ((1.0 / sqrt((9.0 * t_0))) * rand));
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: t_0
t_0 = a - (1.0d0 / 3.0d0)
code = t_0 * (1.0d0 + ((1.0d0 / sqrt((9.0d0 * t_0))) * rand))
end function
public static double code(double a, double rand) {
double t_0 = a - (1.0 / 3.0);
return t_0 * (1.0 + ((1.0 / Math.sqrt((9.0 * t_0))) * rand));
}
def code(a, rand): t_0 = a - (1.0 / 3.0) return t_0 * (1.0 + ((1.0 / math.sqrt((9.0 * t_0))) * rand))
function code(a, rand) t_0 = Float64(a - Float64(1.0 / 3.0)) return Float64(t_0 * Float64(1.0 + Float64(Float64(1.0 / sqrt(Float64(9.0 * t_0))) * rand))) end
function tmp = code(a, rand) t_0 = a - (1.0 / 3.0); tmp = t_0 * (1.0 + ((1.0 / sqrt((9.0 * t_0))) * rand)); end
code[a_, rand_] := Block[{t$95$0 = N[(a - N[(1.0 / 3.0), $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * N[(1.0 + N[(N[(1.0 / N[Sqrt[N[(9.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * rand), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a - \frac{1}{3}\\
t_0 \cdot \left(1 + \frac{1}{\sqrt{9 \cdot t_0}} \cdot rand\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a rand) :precision binary64 (let* ((t_0 (- a (/ 1.0 3.0)))) (* t_0 (+ 1.0 (* (/ 1.0 (sqrt (* 9.0 t_0))) rand)))))
double code(double a, double rand) {
double t_0 = a - (1.0 / 3.0);
return t_0 * (1.0 + ((1.0 / sqrt((9.0 * t_0))) * rand));
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: t_0
t_0 = a - (1.0d0 / 3.0d0)
code = t_0 * (1.0d0 + ((1.0d0 / sqrt((9.0d0 * t_0))) * rand))
end function
public static double code(double a, double rand) {
double t_0 = a - (1.0 / 3.0);
return t_0 * (1.0 + ((1.0 / Math.sqrt((9.0 * t_0))) * rand));
}
def code(a, rand): t_0 = a - (1.0 / 3.0) return t_0 * (1.0 + ((1.0 / math.sqrt((9.0 * t_0))) * rand))
function code(a, rand) t_0 = Float64(a - Float64(1.0 / 3.0)) return Float64(t_0 * Float64(1.0 + Float64(Float64(1.0 / sqrt(Float64(9.0 * t_0))) * rand))) end
function tmp = code(a, rand) t_0 = a - (1.0 / 3.0); tmp = t_0 * (1.0 + ((1.0 / sqrt((9.0 * t_0))) * rand)); end
code[a_, rand_] := Block[{t$95$0 = N[(a - N[(1.0 / 3.0), $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * N[(1.0 + N[(N[(1.0 / N[Sqrt[N[(9.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * rand), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a - \frac{1}{3}\\
t_0 \cdot \left(1 + \frac{1}{\sqrt{9 \cdot t_0}} \cdot rand\right)
\end{array}
\end{array}
(FPCore (a rand) :precision binary64 (- (+ a (/ rand (/ 3.0 (sqrt (+ a -0.3333333333333333))))) 0.3333333333333333))
double code(double a, double rand) {
return (a + (rand / (3.0 / sqrt((a + -0.3333333333333333))))) - 0.3333333333333333;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = (a + (rand / (3.0d0 / sqrt((a + (-0.3333333333333333d0)))))) - 0.3333333333333333d0
end function
public static double code(double a, double rand) {
return (a + (rand / (3.0 / Math.sqrt((a + -0.3333333333333333))))) - 0.3333333333333333;
}
def code(a, rand): return (a + (rand / (3.0 / math.sqrt((a + -0.3333333333333333))))) - 0.3333333333333333
function code(a, rand) return Float64(Float64(a + Float64(rand / Float64(3.0 / sqrt(Float64(a + -0.3333333333333333))))) - 0.3333333333333333) end
function tmp = code(a, rand) tmp = (a + (rand / (3.0 / sqrt((a + -0.3333333333333333))))) - 0.3333333333333333; end
code[a_, rand_] := N[(N[(a + N[(rand / N[(3.0 / N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision]
\begin{array}{l}
\\
\left(a + \frac{rand}{\frac{3}{\sqrt{a + -0.3333333333333333}}}\right) - 0.3333333333333333
\end{array}
Initial program 99.8%
remove-double-neg99.8%
remove-double-neg99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
*-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in rand around 0 99.8%
*-commutative99.8%
metadata-eval99.8%
div-inv99.8%
sub-neg99.8%
metadata-eval99.8%
associate-/l*99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (sqrt (+ a -0.3333333333333333))))
(if (<= rand -4.4e+99)
(/ t_0 (/ 3.0 rand))
(if (<= rand -2e+85)
a
(if (<= rand -3.3e+48)
(* t_0 (/ rand 3.0))
(if (<= rand 1.96e+71)
(- a 0.3333333333333333)
(*
rand
(*
(+ a -0.3333333333333333)
(sqrt (/ 0.1111111111111111 (+ a -0.3333333333333333)))))))))))
double code(double a, double rand) {
double t_0 = sqrt((a + -0.3333333333333333));
double tmp;
if (rand <= -4.4e+99) {
tmp = t_0 / (3.0 / rand);
} else if (rand <= -2e+85) {
tmp = a;
} else if (rand <= -3.3e+48) {
tmp = t_0 * (rand / 3.0);
} else if (rand <= 1.96e+71) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand * ((a + -0.3333333333333333) * sqrt((0.1111111111111111 / (a + -0.3333333333333333))));
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a + (-0.3333333333333333d0)))
if (rand <= (-4.4d+99)) then
tmp = t_0 / (3.0d0 / rand)
else if (rand <= (-2d+85)) then
tmp = a
else if (rand <= (-3.3d+48)) then
tmp = t_0 * (rand / 3.0d0)
else if (rand <= 1.96d+71) then
tmp = a - 0.3333333333333333d0
else
tmp = rand * ((a + (-0.3333333333333333d0)) * sqrt((0.1111111111111111d0 / (a + (-0.3333333333333333d0)))))
end if
code = tmp
end function
public static double code(double a, double rand) {
double t_0 = Math.sqrt((a + -0.3333333333333333));
double tmp;
if (rand <= -4.4e+99) {
tmp = t_0 / (3.0 / rand);
} else if (rand <= -2e+85) {
tmp = a;
} else if (rand <= -3.3e+48) {
tmp = t_0 * (rand / 3.0);
} else if (rand <= 1.96e+71) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand * ((a + -0.3333333333333333) * Math.sqrt((0.1111111111111111 / (a + -0.3333333333333333))));
}
return tmp;
}
def code(a, rand): t_0 = math.sqrt((a + -0.3333333333333333)) tmp = 0 if rand <= -4.4e+99: tmp = t_0 / (3.0 / rand) elif rand <= -2e+85: tmp = a elif rand <= -3.3e+48: tmp = t_0 * (rand / 3.0) elif rand <= 1.96e+71: tmp = a - 0.3333333333333333 else: tmp = rand * ((a + -0.3333333333333333) * math.sqrt((0.1111111111111111 / (a + -0.3333333333333333)))) return tmp
function code(a, rand) t_0 = sqrt(Float64(a + -0.3333333333333333)) tmp = 0.0 if (rand <= -4.4e+99) tmp = Float64(t_0 / Float64(3.0 / rand)); elseif (rand <= -2e+85) tmp = a; elseif (rand <= -3.3e+48) tmp = Float64(t_0 * Float64(rand / 3.0)); elseif (rand <= 1.96e+71) tmp = Float64(a - 0.3333333333333333); else tmp = Float64(rand * Float64(Float64(a + -0.3333333333333333) * sqrt(Float64(0.1111111111111111 / Float64(a + -0.3333333333333333))))); end return tmp end
function tmp_2 = code(a, rand) t_0 = sqrt((a + -0.3333333333333333)); tmp = 0.0; if (rand <= -4.4e+99) tmp = t_0 / (3.0 / rand); elseif (rand <= -2e+85) tmp = a; elseif (rand <= -3.3e+48) tmp = t_0 * (rand / 3.0); elseif (rand <= 1.96e+71) tmp = a - 0.3333333333333333; else tmp = rand * ((a + -0.3333333333333333) * sqrt((0.1111111111111111 / (a + -0.3333333333333333)))); end tmp_2 = tmp; end
code[a_, rand_] := Block[{t$95$0 = N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[rand, -4.4e+99], N[(t$95$0 / N[(3.0 / rand), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, -2e+85], a, If[LessEqual[rand, -3.3e+48], N[(t$95$0 * N[(rand / 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 1.96e+71], N[(a - 0.3333333333333333), $MachinePrecision], N[(rand * N[(N[(a + -0.3333333333333333), $MachinePrecision] * N[Sqrt[N[(0.1111111111111111 / N[(a + -0.3333333333333333), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{a + -0.3333333333333333}\\
\mathbf{if}\;rand \leq -4.4 \cdot 10^{+99}:\\
\;\;\;\;\frac{t_0}{\frac{3}{rand}}\\
\mathbf{elif}\;rand \leq -2 \cdot 10^{+85}:\\
\;\;\;\;a\\
\mathbf{elif}\;rand \leq -3.3 \cdot 10^{+48}:\\
\;\;\;\;t_0 \cdot \frac{rand}{3}\\
\mathbf{elif}\;rand \leq 1.96 \cdot 10^{+71}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;rand \cdot \left(\left(a + -0.3333333333333333\right) \cdot \sqrt{\frac{0.1111111111111111}{a + -0.3333333333333333}}\right)\\
\end{array}
\end{array}
if rand < -4.39999999999999956e99Initial program 99.4%
remove-double-neg99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in rand around inf 98.5%
associate-*r*98.4%
metadata-eval98.4%
associate-/r/98.5%
sub-neg98.5%
metadata-eval98.5%
associate-*l/98.6%
*-un-lft-identity98.6%
Applied egg-rr98.6%
if -4.39999999999999956e99 < rand < -2e85Initial program 100.0%
remove-double-neg100.0%
remove-double-neg100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
*-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around inf 93.8%
if -2e85 < rand < -3.30000000000000023e48Initial program 99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in rand around inf 68.2%
*-commutative68.2%
*-commutative68.2%
sub-neg68.2%
metadata-eval68.2%
associate-*l*68.3%
Simplified68.3%
metadata-eval68.3%
div-inv68.4%
Applied egg-rr68.4%
if -3.30000000000000023e48 < rand < 1.96000000000000011e71Initial program 100.0%
remove-double-neg100.0%
remove-double-neg100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
*-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0 98.5%
if 1.96000000000000011e71 < rand Initial program 99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*l/99.6%
*-lft-identity99.6%
sub-neg99.6%
distribute-rgt-in99.6%
metadata-eval99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in rand around inf 72.7%
*-commutative72.7%
sub-neg72.7%
metadata-eval72.7%
*-commutative72.7%
associate-*r*94.1%
sub-neg94.1%
metadata-eval94.1%
metadata-eval94.1%
distribute-lft-in94.2%
associate-/r*94.3%
metadata-eval94.3%
Simplified94.3%
Final simplification95.6%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (* 0.3333333333333333 (* rand (sqrt (- a 0.3333333333333333))))))
(if (<= rand -2.6e+100)
t_0
(if (<= rand -9.2e+84)
a
(if (or (<= rand -3.3e+48) (not (<= rand 5.6e+69)))
t_0
(- a 0.3333333333333333))))))
double code(double a, double rand) {
double t_0 = 0.3333333333333333 * (rand * sqrt((a - 0.3333333333333333)));
double tmp;
if (rand <= -2.6e+100) {
tmp = t_0;
} else if (rand <= -9.2e+84) {
tmp = a;
} else if ((rand <= -3.3e+48) || !(rand <= 5.6e+69)) {
tmp = t_0;
} else {
tmp = a - 0.3333333333333333;
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: t_0
real(8) :: tmp
t_0 = 0.3333333333333333d0 * (rand * sqrt((a - 0.3333333333333333d0)))
if (rand <= (-2.6d+100)) then
tmp = t_0
else if (rand <= (-9.2d+84)) then
tmp = a
else if ((rand <= (-3.3d+48)) .or. (.not. (rand <= 5.6d+69))) then
tmp = t_0
else
tmp = a - 0.3333333333333333d0
end if
code = tmp
end function
public static double code(double a, double rand) {
double t_0 = 0.3333333333333333 * (rand * Math.sqrt((a - 0.3333333333333333)));
double tmp;
if (rand <= -2.6e+100) {
tmp = t_0;
} else if (rand <= -9.2e+84) {
tmp = a;
} else if ((rand <= -3.3e+48) || !(rand <= 5.6e+69)) {
tmp = t_0;
} else {
tmp = a - 0.3333333333333333;
}
return tmp;
}
def code(a, rand): t_0 = 0.3333333333333333 * (rand * math.sqrt((a - 0.3333333333333333))) tmp = 0 if rand <= -2.6e+100: tmp = t_0 elif rand <= -9.2e+84: tmp = a elif (rand <= -3.3e+48) or not (rand <= 5.6e+69): tmp = t_0 else: tmp = a - 0.3333333333333333 return tmp
function code(a, rand) t_0 = Float64(0.3333333333333333 * Float64(rand * sqrt(Float64(a - 0.3333333333333333)))) tmp = 0.0 if (rand <= -2.6e+100) tmp = t_0; elseif (rand <= -9.2e+84) tmp = a; elseif ((rand <= -3.3e+48) || !(rand <= 5.6e+69)) tmp = t_0; else tmp = Float64(a - 0.3333333333333333); end return tmp end
function tmp_2 = code(a, rand) t_0 = 0.3333333333333333 * (rand * sqrt((a - 0.3333333333333333))); tmp = 0.0; if (rand <= -2.6e+100) tmp = t_0; elseif (rand <= -9.2e+84) tmp = a; elseif ((rand <= -3.3e+48) || ~((rand <= 5.6e+69))) tmp = t_0; else tmp = a - 0.3333333333333333; end tmp_2 = tmp; end
code[a_, rand_] := Block[{t$95$0 = N[(0.3333333333333333 * N[(rand * N[Sqrt[N[(a - 0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -2.6e+100], t$95$0, If[LessEqual[rand, -9.2e+84], a, If[Or[LessEqual[rand, -3.3e+48], N[Not[LessEqual[rand, 5.6e+69]], $MachinePrecision]], t$95$0, N[(a - 0.3333333333333333), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.3333333333333333 \cdot \left(rand \cdot \sqrt{a - 0.3333333333333333}\right)\\
\mathbf{if}\;rand \leq -2.6 \cdot 10^{+100}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;rand \leq -9.2 \cdot 10^{+84}:\\
\;\;\;\;a\\
\mathbf{elif}\;rand \leq -3.3 \cdot 10^{+48} \lor \neg \left(rand \leq 5.6 \cdot 10^{+69}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;a - 0.3333333333333333\\
\end{array}
\end{array}
if rand < -2.6000000000000002e100 or -9.1999999999999996e84 < rand < -3.30000000000000023e48 or 5.59999999999999964e69 < rand Initial program 99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in rand around inf 92.3%
if -2.6000000000000002e100 < rand < -9.1999999999999996e84Initial program 100.0%
remove-double-neg100.0%
remove-double-neg100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
*-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around inf 93.8%
if -3.30000000000000023e48 < rand < 5.59999999999999964e69Initial program 100.0%
remove-double-neg100.0%
remove-double-neg100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
*-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0 98.5%
Final simplification95.6%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (* (sqrt (+ a -0.3333333333333333)) (/ rand 3.0))))
(if (<= rand -2.6e+100)
t_0
(if (<= rand -1.5e+85)
a
(if (or (<= rand -3.3e+48) (not (<= rand 5.8e+76)))
t_0
(- a 0.3333333333333333))))))
double code(double a, double rand) {
double t_0 = sqrt((a + -0.3333333333333333)) * (rand / 3.0);
double tmp;
if (rand <= -2.6e+100) {
tmp = t_0;
} else if (rand <= -1.5e+85) {
tmp = a;
} else if ((rand <= -3.3e+48) || !(rand <= 5.8e+76)) {
tmp = t_0;
} else {
tmp = a - 0.3333333333333333;
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a + (-0.3333333333333333d0))) * (rand / 3.0d0)
if (rand <= (-2.6d+100)) then
tmp = t_0
else if (rand <= (-1.5d+85)) then
tmp = a
else if ((rand <= (-3.3d+48)) .or. (.not. (rand <= 5.8d+76))) then
tmp = t_0
else
tmp = a - 0.3333333333333333d0
end if
code = tmp
end function
public static double code(double a, double rand) {
double t_0 = Math.sqrt((a + -0.3333333333333333)) * (rand / 3.0);
double tmp;
if (rand <= -2.6e+100) {
tmp = t_0;
} else if (rand <= -1.5e+85) {
tmp = a;
} else if ((rand <= -3.3e+48) || !(rand <= 5.8e+76)) {
tmp = t_0;
} else {
tmp = a - 0.3333333333333333;
}
return tmp;
}
def code(a, rand): t_0 = math.sqrt((a + -0.3333333333333333)) * (rand / 3.0) tmp = 0 if rand <= -2.6e+100: tmp = t_0 elif rand <= -1.5e+85: tmp = a elif (rand <= -3.3e+48) or not (rand <= 5.8e+76): tmp = t_0 else: tmp = a - 0.3333333333333333 return tmp
function code(a, rand) t_0 = Float64(sqrt(Float64(a + -0.3333333333333333)) * Float64(rand / 3.0)) tmp = 0.0 if (rand <= -2.6e+100) tmp = t_0; elseif (rand <= -1.5e+85) tmp = a; elseif ((rand <= -3.3e+48) || !(rand <= 5.8e+76)) tmp = t_0; else tmp = Float64(a - 0.3333333333333333); end return tmp end
function tmp_2 = code(a, rand) t_0 = sqrt((a + -0.3333333333333333)) * (rand / 3.0); tmp = 0.0; if (rand <= -2.6e+100) tmp = t_0; elseif (rand <= -1.5e+85) tmp = a; elseif ((rand <= -3.3e+48) || ~((rand <= 5.8e+76))) tmp = t_0; else tmp = a - 0.3333333333333333; end tmp_2 = tmp; end
code[a_, rand_] := Block[{t$95$0 = N[(N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision] * N[(rand / 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -2.6e+100], t$95$0, If[LessEqual[rand, -1.5e+85], a, If[Or[LessEqual[rand, -3.3e+48], N[Not[LessEqual[rand, 5.8e+76]], $MachinePrecision]], t$95$0, N[(a - 0.3333333333333333), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{a + -0.3333333333333333} \cdot \frac{rand}{3}\\
\mathbf{if}\;rand \leq -2.6 \cdot 10^{+100}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;rand \leq -1.5 \cdot 10^{+85}:\\
\;\;\;\;a\\
\mathbf{elif}\;rand \leq -3.3 \cdot 10^{+48} \lor \neg \left(rand \leq 5.8 \cdot 10^{+76}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;a - 0.3333333333333333\\
\end{array}
\end{array}
if rand < -2.6000000000000002e100 or -1.5e85 < rand < -3.30000000000000023e48 or 5.8000000000000003e76 < rand Initial program 99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in rand around inf 93.0%
*-commutative93.0%
*-commutative93.0%
sub-neg93.0%
metadata-eval93.0%
associate-*l*92.9%
Simplified92.9%
metadata-eval92.9%
div-inv93.0%
Applied egg-rr93.0%
if -2.6000000000000002e100 < rand < -1.5e85Initial program 100.0%
remove-double-neg100.0%
remove-double-neg100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
*-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around inf 93.8%
if -3.30000000000000023e48 < rand < 5.8000000000000003e76Initial program 100.0%
remove-double-neg100.0%
remove-double-neg100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
*-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0 97.8%
Final simplification95.6%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (* 0.3333333333333333 (* rand (sqrt (- a 0.3333333333333333))))))
(if (<= rand -1.4e+99)
t_0
(if (<= rand -1.45e+85)
a
(if (<= rand -3.3e+48)
(* (sqrt (+ a -0.3333333333333333)) (* rand 0.3333333333333333))
(if (<= rand 2.75e+70) (- a 0.3333333333333333) t_0))))))
double code(double a, double rand) {
double t_0 = 0.3333333333333333 * (rand * sqrt((a - 0.3333333333333333)));
double tmp;
if (rand <= -1.4e+99) {
tmp = t_0;
} else if (rand <= -1.45e+85) {
tmp = a;
} else if (rand <= -3.3e+48) {
tmp = sqrt((a + -0.3333333333333333)) * (rand * 0.3333333333333333);
} else if (rand <= 2.75e+70) {
tmp = a - 0.3333333333333333;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: t_0
real(8) :: tmp
t_0 = 0.3333333333333333d0 * (rand * sqrt((a - 0.3333333333333333d0)))
if (rand <= (-1.4d+99)) then
tmp = t_0
else if (rand <= (-1.45d+85)) then
tmp = a
else if (rand <= (-3.3d+48)) then
tmp = sqrt((a + (-0.3333333333333333d0))) * (rand * 0.3333333333333333d0)
else if (rand <= 2.75d+70) then
tmp = a - 0.3333333333333333d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double rand) {
double t_0 = 0.3333333333333333 * (rand * Math.sqrt((a - 0.3333333333333333)));
double tmp;
if (rand <= -1.4e+99) {
tmp = t_0;
} else if (rand <= -1.45e+85) {
tmp = a;
} else if (rand <= -3.3e+48) {
tmp = Math.sqrt((a + -0.3333333333333333)) * (rand * 0.3333333333333333);
} else if (rand <= 2.75e+70) {
tmp = a - 0.3333333333333333;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, rand): t_0 = 0.3333333333333333 * (rand * math.sqrt((a - 0.3333333333333333))) tmp = 0 if rand <= -1.4e+99: tmp = t_0 elif rand <= -1.45e+85: tmp = a elif rand <= -3.3e+48: tmp = math.sqrt((a + -0.3333333333333333)) * (rand * 0.3333333333333333) elif rand <= 2.75e+70: tmp = a - 0.3333333333333333 else: tmp = t_0 return tmp
function code(a, rand) t_0 = Float64(0.3333333333333333 * Float64(rand * sqrt(Float64(a - 0.3333333333333333)))) tmp = 0.0 if (rand <= -1.4e+99) tmp = t_0; elseif (rand <= -1.45e+85) tmp = a; elseif (rand <= -3.3e+48) tmp = Float64(sqrt(Float64(a + -0.3333333333333333)) * Float64(rand * 0.3333333333333333)); elseif (rand <= 2.75e+70) tmp = Float64(a - 0.3333333333333333); else tmp = t_0; end return tmp end
function tmp_2 = code(a, rand) t_0 = 0.3333333333333333 * (rand * sqrt((a - 0.3333333333333333))); tmp = 0.0; if (rand <= -1.4e+99) tmp = t_0; elseif (rand <= -1.45e+85) tmp = a; elseif (rand <= -3.3e+48) tmp = sqrt((a + -0.3333333333333333)) * (rand * 0.3333333333333333); elseif (rand <= 2.75e+70) tmp = a - 0.3333333333333333; else tmp = t_0; end tmp_2 = tmp; end
code[a_, rand_] := Block[{t$95$0 = N[(0.3333333333333333 * N[(rand * N[Sqrt[N[(a - 0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -1.4e+99], t$95$0, If[LessEqual[rand, -1.45e+85], a, If[LessEqual[rand, -3.3e+48], N[(N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision] * N[(rand * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 2.75e+70], N[(a - 0.3333333333333333), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.3333333333333333 \cdot \left(rand \cdot \sqrt{a - 0.3333333333333333}\right)\\
\mathbf{if}\;rand \leq -1.4 \cdot 10^{+99}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;rand \leq -1.45 \cdot 10^{+85}:\\
\;\;\;\;a\\
\mathbf{elif}\;rand \leq -3.3 \cdot 10^{+48}:\\
\;\;\;\;\sqrt{a + -0.3333333333333333} \cdot \left(rand \cdot 0.3333333333333333\right)\\
\mathbf{elif}\;rand \leq 2.75 \cdot 10^{+70}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if rand < -1.4e99 or 2.74999999999999993e70 < rand Initial program 99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in rand around inf 95.9%
if -1.4e99 < rand < -1.44999999999999999e85Initial program 100.0%
remove-double-neg100.0%
remove-double-neg100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
*-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around inf 93.8%
if -1.44999999999999999e85 < rand < -3.30000000000000023e48Initial program 99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in rand around inf 68.2%
*-commutative68.2%
*-commutative68.2%
sub-neg68.2%
metadata-eval68.2%
associate-*l*68.3%
Simplified68.3%
if -3.30000000000000023e48 < rand < 2.74999999999999993e70Initial program 100.0%
remove-double-neg100.0%
remove-double-neg100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
*-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0 98.5%
Final simplification95.6%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (sqrt (+ a -0.3333333333333333))) (t_1 (* t_0 (/ rand 3.0))))
(if (<= rand -9.2e+98)
t_1
(if (<= rand -2.25e+85)
a
(if (<= rand -3.3e+48)
t_1
(if (<= rand 1.3e+71)
(- a 0.3333333333333333)
(/ rand (/ 3.0 t_0))))))))
double code(double a, double rand) {
double t_0 = sqrt((a + -0.3333333333333333));
double t_1 = t_0 * (rand / 3.0);
double tmp;
if (rand <= -9.2e+98) {
tmp = t_1;
} else if (rand <= -2.25e+85) {
tmp = a;
} else if (rand <= -3.3e+48) {
tmp = t_1;
} else if (rand <= 1.3e+71) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand / (3.0 / t_0);
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((a + (-0.3333333333333333d0)))
t_1 = t_0 * (rand / 3.0d0)
if (rand <= (-9.2d+98)) then
tmp = t_1
else if (rand <= (-2.25d+85)) then
tmp = a
else if (rand <= (-3.3d+48)) then
tmp = t_1
else if (rand <= 1.3d+71) then
tmp = a - 0.3333333333333333d0
else
tmp = rand / (3.0d0 / t_0)
end if
code = tmp
end function
public static double code(double a, double rand) {
double t_0 = Math.sqrt((a + -0.3333333333333333));
double t_1 = t_0 * (rand / 3.0);
double tmp;
if (rand <= -9.2e+98) {
tmp = t_1;
} else if (rand <= -2.25e+85) {
tmp = a;
} else if (rand <= -3.3e+48) {
tmp = t_1;
} else if (rand <= 1.3e+71) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand / (3.0 / t_0);
}
return tmp;
}
def code(a, rand): t_0 = math.sqrt((a + -0.3333333333333333)) t_1 = t_0 * (rand / 3.0) tmp = 0 if rand <= -9.2e+98: tmp = t_1 elif rand <= -2.25e+85: tmp = a elif rand <= -3.3e+48: tmp = t_1 elif rand <= 1.3e+71: tmp = a - 0.3333333333333333 else: tmp = rand / (3.0 / t_0) return tmp
function code(a, rand) t_0 = sqrt(Float64(a + -0.3333333333333333)) t_1 = Float64(t_0 * Float64(rand / 3.0)) tmp = 0.0 if (rand <= -9.2e+98) tmp = t_1; elseif (rand <= -2.25e+85) tmp = a; elseif (rand <= -3.3e+48) tmp = t_1; elseif (rand <= 1.3e+71) tmp = Float64(a - 0.3333333333333333); else tmp = Float64(rand / Float64(3.0 / t_0)); end return tmp end
function tmp_2 = code(a, rand) t_0 = sqrt((a + -0.3333333333333333)); t_1 = t_0 * (rand / 3.0); tmp = 0.0; if (rand <= -9.2e+98) tmp = t_1; elseif (rand <= -2.25e+85) tmp = a; elseif (rand <= -3.3e+48) tmp = t_1; elseif (rand <= 1.3e+71) tmp = a - 0.3333333333333333; else tmp = rand / (3.0 / t_0); end tmp_2 = tmp; end
code[a_, rand_] := Block[{t$95$0 = N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(rand / 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -9.2e+98], t$95$1, If[LessEqual[rand, -2.25e+85], a, If[LessEqual[rand, -3.3e+48], t$95$1, If[LessEqual[rand, 1.3e+71], N[(a - 0.3333333333333333), $MachinePrecision], N[(rand / N[(3.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{a + -0.3333333333333333}\\
t_1 := t_0 \cdot \frac{rand}{3}\\
\mathbf{if}\;rand \leq -9.2 \cdot 10^{+98}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;rand \leq -2.25 \cdot 10^{+85}:\\
\;\;\;\;a\\
\mathbf{elif}\;rand \leq -3.3 \cdot 10^{+48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;rand \leq 1.3 \cdot 10^{+71}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{rand}{\frac{3}{t_0}}\\
\end{array}
\end{array}
if rand < -9.20000000000000053e98 or -2.25000000000000003e85 < rand < -3.30000000000000023e48Initial program 99.4%
remove-double-neg99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in rand around inf 90.5%
*-commutative90.5%
*-commutative90.5%
sub-neg90.5%
metadata-eval90.5%
associate-*l*90.5%
Simplified90.5%
metadata-eval90.5%
div-inv90.6%
Applied egg-rr90.6%
if -9.20000000000000053e98 < rand < -2.25000000000000003e85Initial program 100.0%
remove-double-neg100.0%
remove-double-neg100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
*-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around inf 93.8%
if -3.30000000000000023e48 < rand < 1.29999999999999996e71Initial program 100.0%
remove-double-neg100.0%
remove-double-neg100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
*-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0 98.5%
if 1.29999999999999996e71 < rand Initial program 99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in rand around inf 94.0%
*-commutative99.5%
metadata-eval99.5%
div-inv99.6%
sub-neg99.6%
metadata-eval99.6%
associate-/l*99.6%
Applied egg-rr94.1%
Final simplification95.6%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (sqrt (+ a -0.3333333333333333))))
(if (<= rand -8.5e+98)
(/ t_0 (/ 3.0 rand))
(if (<= rand -1.36e+85)
a
(if (<= rand -3.3e+48)
(* t_0 (/ rand 3.0))
(if (<= rand 1.42e+71)
(- a 0.3333333333333333)
(/ rand (/ 3.0 t_0))))))))
double code(double a, double rand) {
double t_0 = sqrt((a + -0.3333333333333333));
double tmp;
if (rand <= -8.5e+98) {
tmp = t_0 / (3.0 / rand);
} else if (rand <= -1.36e+85) {
tmp = a;
} else if (rand <= -3.3e+48) {
tmp = t_0 * (rand / 3.0);
} else if (rand <= 1.42e+71) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand / (3.0 / t_0);
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a + (-0.3333333333333333d0)))
if (rand <= (-8.5d+98)) then
tmp = t_0 / (3.0d0 / rand)
else if (rand <= (-1.36d+85)) then
tmp = a
else if (rand <= (-3.3d+48)) then
tmp = t_0 * (rand / 3.0d0)
else if (rand <= 1.42d+71) then
tmp = a - 0.3333333333333333d0
else
tmp = rand / (3.0d0 / t_0)
end if
code = tmp
end function
public static double code(double a, double rand) {
double t_0 = Math.sqrt((a + -0.3333333333333333));
double tmp;
if (rand <= -8.5e+98) {
tmp = t_0 / (3.0 / rand);
} else if (rand <= -1.36e+85) {
tmp = a;
} else if (rand <= -3.3e+48) {
tmp = t_0 * (rand / 3.0);
} else if (rand <= 1.42e+71) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand / (3.0 / t_0);
}
return tmp;
}
def code(a, rand): t_0 = math.sqrt((a + -0.3333333333333333)) tmp = 0 if rand <= -8.5e+98: tmp = t_0 / (3.0 / rand) elif rand <= -1.36e+85: tmp = a elif rand <= -3.3e+48: tmp = t_0 * (rand / 3.0) elif rand <= 1.42e+71: tmp = a - 0.3333333333333333 else: tmp = rand / (3.0 / t_0) return tmp
function code(a, rand) t_0 = sqrt(Float64(a + -0.3333333333333333)) tmp = 0.0 if (rand <= -8.5e+98) tmp = Float64(t_0 / Float64(3.0 / rand)); elseif (rand <= -1.36e+85) tmp = a; elseif (rand <= -3.3e+48) tmp = Float64(t_0 * Float64(rand / 3.0)); elseif (rand <= 1.42e+71) tmp = Float64(a - 0.3333333333333333); else tmp = Float64(rand / Float64(3.0 / t_0)); end return tmp end
function tmp_2 = code(a, rand) t_0 = sqrt((a + -0.3333333333333333)); tmp = 0.0; if (rand <= -8.5e+98) tmp = t_0 / (3.0 / rand); elseif (rand <= -1.36e+85) tmp = a; elseif (rand <= -3.3e+48) tmp = t_0 * (rand / 3.0); elseif (rand <= 1.42e+71) tmp = a - 0.3333333333333333; else tmp = rand / (3.0 / t_0); end tmp_2 = tmp; end
code[a_, rand_] := Block[{t$95$0 = N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[rand, -8.5e+98], N[(t$95$0 / N[(3.0 / rand), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, -1.36e+85], a, If[LessEqual[rand, -3.3e+48], N[(t$95$0 * N[(rand / 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 1.42e+71], N[(a - 0.3333333333333333), $MachinePrecision], N[(rand / N[(3.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{a + -0.3333333333333333}\\
\mathbf{if}\;rand \leq -8.5 \cdot 10^{+98}:\\
\;\;\;\;\frac{t_0}{\frac{3}{rand}}\\
\mathbf{elif}\;rand \leq -1.36 \cdot 10^{+85}:\\
\;\;\;\;a\\
\mathbf{elif}\;rand \leq -3.3 \cdot 10^{+48}:\\
\;\;\;\;t_0 \cdot \frac{rand}{3}\\
\mathbf{elif}\;rand \leq 1.42 \cdot 10^{+71}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{rand}{\frac{3}{t_0}}\\
\end{array}
\end{array}
if rand < -8.4999999999999996e98Initial program 99.4%
remove-double-neg99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in rand around inf 98.5%
associate-*r*98.4%
metadata-eval98.4%
associate-/r/98.5%
sub-neg98.5%
metadata-eval98.5%
associate-*l/98.6%
*-un-lft-identity98.6%
Applied egg-rr98.6%
if -8.4999999999999996e98 < rand < -1.3599999999999999e85Initial program 100.0%
remove-double-neg100.0%
remove-double-neg100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
*-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around inf 93.8%
if -1.3599999999999999e85 < rand < -3.30000000000000023e48Initial program 99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in rand around inf 68.2%
*-commutative68.2%
*-commutative68.2%
sub-neg68.2%
metadata-eval68.2%
associate-*l*68.3%
Simplified68.3%
metadata-eval68.3%
div-inv68.4%
Applied egg-rr68.4%
if -3.30000000000000023e48 < rand < 1.42000000000000012e71Initial program 100.0%
remove-double-neg100.0%
remove-double-neg100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
*-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0 98.5%
if 1.42000000000000012e71 < rand Initial program 99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in rand around inf 94.0%
*-commutative99.5%
metadata-eval99.5%
div-inv99.6%
sub-neg99.6%
metadata-eval99.6%
associate-/l*99.6%
Applied egg-rr94.1%
Final simplification95.6%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (sqrt (+ a -0.3333333333333333))))
(if (<= rand -8.8e+98)
(/ t_0 (/ 3.0 rand))
(if (<= rand -1.75e+85)
a
(if (<= rand -3.3e+48)
(* t_0 (/ rand 3.0))
(if (<= rand 1.8e+70)
(- a 0.3333333333333333)
(/ (* rand t_0) 3.0)))))))
double code(double a, double rand) {
double t_0 = sqrt((a + -0.3333333333333333));
double tmp;
if (rand <= -8.8e+98) {
tmp = t_0 / (3.0 / rand);
} else if (rand <= -1.75e+85) {
tmp = a;
} else if (rand <= -3.3e+48) {
tmp = t_0 * (rand / 3.0);
} else if (rand <= 1.8e+70) {
tmp = a - 0.3333333333333333;
} else {
tmp = (rand * t_0) / 3.0;
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a + (-0.3333333333333333d0)))
if (rand <= (-8.8d+98)) then
tmp = t_0 / (3.0d0 / rand)
else if (rand <= (-1.75d+85)) then
tmp = a
else if (rand <= (-3.3d+48)) then
tmp = t_0 * (rand / 3.0d0)
else if (rand <= 1.8d+70) then
tmp = a - 0.3333333333333333d0
else
tmp = (rand * t_0) / 3.0d0
end if
code = tmp
end function
public static double code(double a, double rand) {
double t_0 = Math.sqrt((a + -0.3333333333333333));
double tmp;
if (rand <= -8.8e+98) {
tmp = t_0 / (3.0 / rand);
} else if (rand <= -1.75e+85) {
tmp = a;
} else if (rand <= -3.3e+48) {
tmp = t_0 * (rand / 3.0);
} else if (rand <= 1.8e+70) {
tmp = a - 0.3333333333333333;
} else {
tmp = (rand * t_0) / 3.0;
}
return tmp;
}
def code(a, rand): t_0 = math.sqrt((a + -0.3333333333333333)) tmp = 0 if rand <= -8.8e+98: tmp = t_0 / (3.0 / rand) elif rand <= -1.75e+85: tmp = a elif rand <= -3.3e+48: tmp = t_0 * (rand / 3.0) elif rand <= 1.8e+70: tmp = a - 0.3333333333333333 else: tmp = (rand * t_0) / 3.0 return tmp
function code(a, rand) t_0 = sqrt(Float64(a + -0.3333333333333333)) tmp = 0.0 if (rand <= -8.8e+98) tmp = Float64(t_0 / Float64(3.0 / rand)); elseif (rand <= -1.75e+85) tmp = a; elseif (rand <= -3.3e+48) tmp = Float64(t_0 * Float64(rand / 3.0)); elseif (rand <= 1.8e+70) tmp = Float64(a - 0.3333333333333333); else tmp = Float64(Float64(rand * t_0) / 3.0); end return tmp end
function tmp_2 = code(a, rand) t_0 = sqrt((a + -0.3333333333333333)); tmp = 0.0; if (rand <= -8.8e+98) tmp = t_0 / (3.0 / rand); elseif (rand <= -1.75e+85) tmp = a; elseif (rand <= -3.3e+48) tmp = t_0 * (rand / 3.0); elseif (rand <= 1.8e+70) tmp = a - 0.3333333333333333; else tmp = (rand * t_0) / 3.0; end tmp_2 = tmp; end
code[a_, rand_] := Block[{t$95$0 = N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[rand, -8.8e+98], N[(t$95$0 / N[(3.0 / rand), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, -1.75e+85], a, If[LessEqual[rand, -3.3e+48], N[(t$95$0 * N[(rand / 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 1.8e+70], N[(a - 0.3333333333333333), $MachinePrecision], N[(N[(rand * t$95$0), $MachinePrecision] / 3.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{a + -0.3333333333333333}\\
\mathbf{if}\;rand \leq -8.8 \cdot 10^{+98}:\\
\;\;\;\;\frac{t_0}{\frac{3}{rand}}\\
\mathbf{elif}\;rand \leq -1.75 \cdot 10^{+85}:\\
\;\;\;\;a\\
\mathbf{elif}\;rand \leq -3.3 \cdot 10^{+48}:\\
\;\;\;\;t_0 \cdot \frac{rand}{3}\\
\mathbf{elif}\;rand \leq 1.8 \cdot 10^{+70}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{rand \cdot t_0}{3}\\
\end{array}
\end{array}
if rand < -8.80000000000000034e98Initial program 99.4%
remove-double-neg99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in rand around inf 98.5%
associate-*r*98.4%
metadata-eval98.4%
associate-/r/98.5%
sub-neg98.5%
metadata-eval98.5%
associate-*l/98.6%
*-un-lft-identity98.6%
Applied egg-rr98.6%
if -8.80000000000000034e98 < rand < -1.75000000000000003e85Initial program 100.0%
remove-double-neg100.0%
remove-double-neg100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
*-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around inf 93.8%
if -1.75000000000000003e85 < rand < -3.30000000000000023e48Initial program 99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in rand around inf 68.2%
*-commutative68.2%
*-commutative68.2%
sub-neg68.2%
metadata-eval68.2%
associate-*l*68.3%
Simplified68.3%
metadata-eval68.3%
div-inv68.4%
Applied egg-rr68.4%
if -3.30000000000000023e48 < rand < 1.8e70Initial program 100.0%
remove-double-neg100.0%
remove-double-neg100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
*-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0 98.5%
if 1.8e70 < rand Initial program 99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in rand around inf 94.0%
*-commutative94.0%
metadata-eval94.0%
div-inv94.1%
sub-neg94.1%
metadata-eval94.1%
Applied egg-rr94.1%
Final simplification95.6%
(FPCore (a rand)
:precision binary64
(if (<= a 9500000000.0)
(/ (sqrt (+ a -0.3333333333333333)) (/ 3.0 rand))
(*
(+ a -0.3333333333333333)
(+ 1.0 (* 0.3333333333333333 (/ rand (sqrt a)))))))
double code(double a, double rand) {
double tmp;
if (a <= 9500000000.0) {
tmp = sqrt((a + -0.3333333333333333)) / (3.0 / rand);
} else {
tmp = (a + -0.3333333333333333) * (1.0 + (0.3333333333333333 * (rand / sqrt(a))));
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: tmp
if (a <= 9500000000.0d0) then
tmp = sqrt((a + (-0.3333333333333333d0))) / (3.0d0 / rand)
else
tmp = (a + (-0.3333333333333333d0)) * (1.0d0 + (0.3333333333333333d0 * (rand / sqrt(a))))
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if (a <= 9500000000.0) {
tmp = Math.sqrt((a + -0.3333333333333333)) / (3.0 / rand);
} else {
tmp = (a + -0.3333333333333333) * (1.0 + (0.3333333333333333 * (rand / Math.sqrt(a))));
}
return tmp;
}
def code(a, rand): tmp = 0 if a <= 9500000000.0: tmp = math.sqrt((a + -0.3333333333333333)) / (3.0 / rand) else: tmp = (a + -0.3333333333333333) * (1.0 + (0.3333333333333333 * (rand / math.sqrt(a)))) return tmp
function code(a, rand) tmp = 0.0 if (a <= 9500000000.0) tmp = Float64(sqrt(Float64(a + -0.3333333333333333)) / Float64(3.0 / rand)); else tmp = Float64(Float64(a + -0.3333333333333333) * Float64(1.0 + Float64(0.3333333333333333 * Float64(rand / sqrt(a))))); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if (a <= 9500000000.0) tmp = sqrt((a + -0.3333333333333333)) / (3.0 / rand); else tmp = (a + -0.3333333333333333) * (1.0 + (0.3333333333333333 * (rand / sqrt(a)))); end tmp_2 = tmp; end
code[a_, rand_] := If[LessEqual[a, 9500000000.0], N[(N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision] / N[(3.0 / rand), $MachinePrecision]), $MachinePrecision], N[(N[(a + -0.3333333333333333), $MachinePrecision] * N[(1.0 + N[(0.3333333333333333 * N[(rand / N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 9500000000:\\
\;\;\;\;\frac{\sqrt{a + -0.3333333333333333}}{\frac{3}{rand}}\\
\mathbf{else}:\\
\;\;\;\;\left(a + -0.3333333333333333\right) \cdot \left(1 + 0.3333333333333333 \cdot \frac{rand}{\sqrt{a}}\right)\\
\end{array}
\end{array}
if a < 9.5e9Initial program 99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in rand around inf 91.1%
associate-*r*91.0%
metadata-eval91.0%
associate-/r/91.0%
sub-neg91.0%
metadata-eval91.0%
associate-*l/91.3%
*-un-lft-identity91.3%
Applied egg-rr91.3%
if 9.5e9 < a Initial program 99.8%
remove-double-neg99.8%
remove-double-neg99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
associate-*l/99.8%
*-lft-identity99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 99.7%
*-commutative99.7%
Simplified99.7%
*-un-lft-identity99.7%
sqrt-prod99.7%
metadata-eval99.7%
times-frac99.7%
div-inv99.6%
metadata-eval99.6%
Applied egg-rr99.6%
associate-*r*99.7%
associate-*l/99.6%
*-lft-identity99.6%
Simplified99.6%
Final simplification99.3%
(FPCore (a rand) :precision binary64 (if (<= a 9500000000.0) (/ (sqrt (+ a -0.3333333333333333)) (/ 3.0 rand)) (* (+ a -0.3333333333333333) (+ 1.0 (/ rand (sqrt (* a 9.0)))))))
double code(double a, double rand) {
double tmp;
if (a <= 9500000000.0) {
tmp = sqrt((a + -0.3333333333333333)) / (3.0 / rand);
} else {
tmp = (a + -0.3333333333333333) * (1.0 + (rand / sqrt((a * 9.0))));
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: tmp
if (a <= 9500000000.0d0) then
tmp = sqrt((a + (-0.3333333333333333d0))) / (3.0d0 / rand)
else
tmp = (a + (-0.3333333333333333d0)) * (1.0d0 + (rand / sqrt((a * 9.0d0))))
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if (a <= 9500000000.0) {
tmp = Math.sqrt((a + -0.3333333333333333)) / (3.0 / rand);
} else {
tmp = (a + -0.3333333333333333) * (1.0 + (rand / Math.sqrt((a * 9.0))));
}
return tmp;
}
def code(a, rand): tmp = 0 if a <= 9500000000.0: tmp = math.sqrt((a + -0.3333333333333333)) / (3.0 / rand) else: tmp = (a + -0.3333333333333333) * (1.0 + (rand / math.sqrt((a * 9.0)))) return tmp
function code(a, rand) tmp = 0.0 if (a <= 9500000000.0) tmp = Float64(sqrt(Float64(a + -0.3333333333333333)) / Float64(3.0 / rand)); else tmp = Float64(Float64(a + -0.3333333333333333) * Float64(1.0 + Float64(rand / sqrt(Float64(a * 9.0))))); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if (a <= 9500000000.0) tmp = sqrt((a + -0.3333333333333333)) / (3.0 / rand); else tmp = (a + -0.3333333333333333) * (1.0 + (rand / sqrt((a * 9.0)))); end tmp_2 = tmp; end
code[a_, rand_] := If[LessEqual[a, 9500000000.0], N[(N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision] / N[(3.0 / rand), $MachinePrecision]), $MachinePrecision], N[(N[(a + -0.3333333333333333), $MachinePrecision] * N[(1.0 + N[(rand / N[Sqrt[N[(a * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 9500000000:\\
\;\;\;\;\frac{\sqrt{a + -0.3333333333333333}}{\frac{3}{rand}}\\
\mathbf{else}:\\
\;\;\;\;\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{a \cdot 9}}\right)\\
\end{array}
\end{array}
if a < 9.5e9Initial program 99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in rand around inf 91.1%
associate-*r*91.0%
metadata-eval91.0%
associate-/r/91.0%
sub-neg91.0%
metadata-eval91.0%
associate-*l/91.3%
*-un-lft-identity91.3%
Applied egg-rr91.3%
if 9.5e9 < a Initial program 99.8%
remove-double-neg99.8%
remove-double-neg99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
associate-*l/99.8%
*-lft-identity99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 99.7%
*-commutative99.7%
Simplified99.7%
Final simplification99.3%
(FPCore (a rand) :precision binary64 (- (+ a (* 0.3333333333333333 (* rand (sqrt (- a 0.3333333333333333))))) 0.3333333333333333))
double code(double a, double rand) {
return (a + (0.3333333333333333 * (rand * sqrt((a - 0.3333333333333333))))) - 0.3333333333333333;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = (a + (0.3333333333333333d0 * (rand * sqrt((a - 0.3333333333333333d0))))) - 0.3333333333333333d0
end function
public static double code(double a, double rand) {
return (a + (0.3333333333333333 * (rand * Math.sqrt((a - 0.3333333333333333))))) - 0.3333333333333333;
}
def code(a, rand): return (a + (0.3333333333333333 * (rand * math.sqrt((a - 0.3333333333333333))))) - 0.3333333333333333
function code(a, rand) return Float64(Float64(a + Float64(0.3333333333333333 * Float64(rand * sqrt(Float64(a - 0.3333333333333333))))) - 0.3333333333333333) end
function tmp = code(a, rand) tmp = (a + (0.3333333333333333 * (rand * sqrt((a - 0.3333333333333333))))) - 0.3333333333333333; end
code[a_, rand_] := N[(N[(a + N[(0.3333333333333333 * N[(rand * N[Sqrt[N[(a - 0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision]
\begin{array}{l}
\\
\left(a + 0.3333333333333333 \cdot \left(rand \cdot \sqrt{a - 0.3333333333333333}\right)\right) - 0.3333333333333333
\end{array}
Initial program 99.8%
remove-double-neg99.8%
remove-double-neg99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
*-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in rand around 0 99.8%
Final simplification99.8%
(FPCore (a rand) :precision binary64 (- a 0.3333333333333333))
double code(double a, double rand) {
return a - 0.3333333333333333;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = a - 0.3333333333333333d0
end function
public static double code(double a, double rand) {
return a - 0.3333333333333333;
}
def code(a, rand): return a - 0.3333333333333333
function code(a, rand) return Float64(a - 0.3333333333333333) end
function tmp = code(a, rand) tmp = a - 0.3333333333333333; end
code[a_, rand_] := N[(a - 0.3333333333333333), $MachinePrecision]
\begin{array}{l}
\\
a - 0.3333333333333333
\end{array}
Initial program 99.8%
remove-double-neg99.8%
remove-double-neg99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
*-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in rand around 0 57.8%
Final simplification57.8%
(FPCore (a rand) :precision binary64 a)
double code(double a, double rand) {
return a;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = a
end function
public static double code(double a, double rand) {
return a;
}
def code(a, rand): return a
function code(a, rand) return a end
function tmp = code(a, rand) tmp = a; end
code[a_, rand_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 99.8%
remove-double-neg99.8%
remove-double-neg99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
*-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 57.5%
Final simplification57.5%
herbie shell --seed 2023274
(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))))