
(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 15 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 -0.3333333333333333) (+ 1.0 (* (/ 0.3333333333333333 (sqrt (+ a -0.3333333333333333))) rand))))
double code(double a, double rand) {
return (a + -0.3333333333333333) * (1.0 + ((0.3333333333333333 / sqrt((a + -0.3333333333333333))) * rand));
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = (a + (-0.3333333333333333d0)) * (1.0d0 + ((0.3333333333333333d0 / sqrt((a + (-0.3333333333333333d0)))) * rand))
end function
public static double code(double a, double rand) {
return (a + -0.3333333333333333) * (1.0 + ((0.3333333333333333 / Math.sqrt((a + -0.3333333333333333))) * rand));
}
def code(a, rand): return (a + -0.3333333333333333) * (1.0 + ((0.3333333333333333 / math.sqrt((a + -0.3333333333333333))) * rand))
function code(a, rand) return Float64(Float64(a + -0.3333333333333333) * Float64(1.0 + Float64(Float64(0.3333333333333333 / sqrt(Float64(a + -0.3333333333333333))) * rand))) end
function tmp = code(a, rand) tmp = (a + -0.3333333333333333) * (1.0 + ((0.3333333333333333 / sqrt((a + -0.3333333333333333))) * rand)); end
code[a_, rand_] := N[(N[(a + -0.3333333333333333), $MachinePrecision] * N[(1.0 + N[(N[(0.3333333333333333 / N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * rand), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{0.3333333333333333}{\sqrt{a + -0.3333333333333333}} \cdot rand\right)
\end{array}
Initial program 99.6%
*-lft-identity99.6%
*-lft-identity99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
inv-pow99.6%
sqrt-prod99.8%
unpow-prod-down99.8%
metadata-eval99.8%
metadata-eval99.8%
Applied egg-rr99.8%
unpow-199.8%
associate-*l/99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (a rand) :precision binary64 (if (or (<= rand -3.6e+92) (not (<= rand 7e+45))) (* 0.3333333333333333 (* rand (sqrt (- a 0.3333333333333333)))) (- a 0.3333333333333333)))
double code(double a, double rand) {
double tmp;
if ((rand <= -3.6e+92) || !(rand <= 7e+45)) {
tmp = 0.3333333333333333 * (rand * sqrt((a - 0.3333333333333333)));
} 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) :: tmp
if ((rand <= (-3.6d+92)) .or. (.not. (rand <= 7d+45))) then
tmp = 0.3333333333333333d0 * (rand * sqrt((a - 0.3333333333333333d0)))
else
tmp = a - 0.3333333333333333d0
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if ((rand <= -3.6e+92) || !(rand <= 7e+45)) {
tmp = 0.3333333333333333 * (rand * Math.sqrt((a - 0.3333333333333333)));
} else {
tmp = a - 0.3333333333333333;
}
return tmp;
}
def code(a, rand): tmp = 0 if (rand <= -3.6e+92) or not (rand <= 7e+45): tmp = 0.3333333333333333 * (rand * math.sqrt((a - 0.3333333333333333))) else: tmp = a - 0.3333333333333333 return tmp
function code(a, rand) tmp = 0.0 if ((rand <= -3.6e+92) || !(rand <= 7e+45)) tmp = Float64(0.3333333333333333 * Float64(rand * sqrt(Float64(a - 0.3333333333333333)))); else tmp = Float64(a - 0.3333333333333333); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if ((rand <= -3.6e+92) || ~((rand <= 7e+45))) tmp = 0.3333333333333333 * (rand * sqrt((a - 0.3333333333333333))); else tmp = a - 0.3333333333333333; end tmp_2 = tmp; end
code[a_, rand_] := If[Or[LessEqual[rand, -3.6e+92], N[Not[LessEqual[rand, 7e+45]], $MachinePrecision]], N[(0.3333333333333333 * N[(rand * N[Sqrt[N[(a - 0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a - 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -3.6 \cdot 10^{+92} \lor \neg \left(rand \leq 7 \cdot 10^{+45}\right):\\
\;\;\;\;0.3333333333333333 \cdot \left(rand \cdot \sqrt{a - 0.3333333333333333}\right)\\
\mathbf{else}:\\
\;\;\;\;a - 0.3333333333333333\\
\end{array}
\end{array}
if rand < -3.6e92 or 7.00000000000000046e45 < rand Initial program 99.0%
*-lft-identity99.0%
*-lft-identity99.0%
sub-neg99.0%
metadata-eval99.0%
metadata-eval99.0%
*-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
metadata-eval99.0%
Simplified99.0%
inv-pow99.0%
sqrt-prod99.6%
unpow-prod-down99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
unpow-199.6%
associate-*l/99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in rand around inf 93.6%
if -3.6e92 < rand < 7.00000000000000046e45Initial program 100.0%
*-lft-identity100.0%
*-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
associate-*l/100.0%
*-lft-identity100.0%
sub-neg100.0%
distribute-lft-in100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0 95.2%
Final simplification94.6%
(FPCore (a rand)
:precision binary64
(if (<= rand -2.75e+94)
(* (sqrt (+ a -0.3333333333333333)) (* 0.3333333333333333 rand))
(if (<= rand 1.25e+48)
(- a 0.3333333333333333)
(* 0.3333333333333333 (* rand (sqrt (- a 0.3333333333333333)))))))
double code(double a, double rand) {
double tmp;
if (rand <= -2.75e+94) {
tmp = sqrt((a + -0.3333333333333333)) * (0.3333333333333333 * rand);
} else if (rand <= 1.25e+48) {
tmp = a - 0.3333333333333333;
} else {
tmp = 0.3333333333333333 * (rand * sqrt((a - 0.3333333333333333)));
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: tmp
if (rand <= (-2.75d+94)) then
tmp = sqrt((a + (-0.3333333333333333d0))) * (0.3333333333333333d0 * rand)
else if (rand <= 1.25d+48) then
tmp = a - 0.3333333333333333d0
else
tmp = 0.3333333333333333d0 * (rand * sqrt((a - 0.3333333333333333d0)))
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if (rand <= -2.75e+94) {
tmp = Math.sqrt((a + -0.3333333333333333)) * (0.3333333333333333 * rand);
} else if (rand <= 1.25e+48) {
tmp = a - 0.3333333333333333;
} else {
tmp = 0.3333333333333333 * (rand * Math.sqrt((a - 0.3333333333333333)));
}
return tmp;
}
def code(a, rand): tmp = 0 if rand <= -2.75e+94: tmp = math.sqrt((a + -0.3333333333333333)) * (0.3333333333333333 * rand) elif rand <= 1.25e+48: tmp = a - 0.3333333333333333 else: tmp = 0.3333333333333333 * (rand * math.sqrt((a - 0.3333333333333333))) return tmp
function code(a, rand) tmp = 0.0 if (rand <= -2.75e+94) tmp = Float64(sqrt(Float64(a + -0.3333333333333333)) * Float64(0.3333333333333333 * rand)); elseif (rand <= 1.25e+48) tmp = Float64(a - 0.3333333333333333); else tmp = Float64(0.3333333333333333 * Float64(rand * sqrt(Float64(a - 0.3333333333333333)))); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if (rand <= -2.75e+94) tmp = sqrt((a + -0.3333333333333333)) * (0.3333333333333333 * rand); elseif (rand <= 1.25e+48) tmp = a - 0.3333333333333333; else tmp = 0.3333333333333333 * (rand * sqrt((a - 0.3333333333333333))); end tmp_2 = tmp; end
code[a_, rand_] := If[LessEqual[rand, -2.75e+94], N[(N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision] * N[(0.3333333333333333 * rand), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 1.25e+48], N[(a - 0.3333333333333333), $MachinePrecision], N[(0.3333333333333333 * N[(rand * N[Sqrt[N[(a - 0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -2.75 \cdot 10^{+94}:\\
\;\;\;\;\sqrt{a + -0.3333333333333333} \cdot \left(0.3333333333333333 \cdot rand\right)\\
\mathbf{elif}\;rand \leq 1.25 \cdot 10^{+48}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \left(rand \cdot \sqrt{a - 0.3333333333333333}\right)\\
\end{array}
\end{array}
if rand < -2.7499999999999999e94Initial program 98.3%
*-lft-identity98.3%
*-lft-identity98.3%
sub-neg98.3%
metadata-eval98.3%
metadata-eval98.3%
*-commutative98.3%
sub-neg98.3%
metadata-eval98.3%
metadata-eval98.3%
Simplified98.3%
inv-pow98.3%
sqrt-prod99.6%
unpow-prod-down99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
unpow-199.6%
associate-*l/99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in rand around inf 91.8%
associate-*r*91.8%
sub-neg91.8%
metadata-eval91.8%
Simplified91.8%
if -2.7499999999999999e94 < rand < 1.24999999999999993e48Initial program 100.0%
*-lft-identity100.0%
*-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
associate-*l/100.0%
*-lft-identity100.0%
sub-neg100.0%
distribute-lft-in100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0 95.2%
if 1.24999999999999993e48 < rand Initial program 99.6%
*-lft-identity99.6%
*-lft-identity99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
inv-pow99.6%
sqrt-prod99.6%
unpow-prod-down99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
unpow-199.6%
associate-*l/99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in rand around inf 95.2%
Final simplification94.6%
(FPCore (a rand)
:precision binary64
(if (<= rand -2.1e+92)
(* (/ rand 3.0) (sqrt (+ a -0.3333333333333333)))
(if (<= rand 1.25e+48)
(- a 0.3333333333333333)
(* 0.3333333333333333 (* rand (sqrt (- a 0.3333333333333333)))))))
double code(double a, double rand) {
double tmp;
if (rand <= -2.1e+92) {
tmp = (rand / 3.0) * sqrt((a + -0.3333333333333333));
} else if (rand <= 1.25e+48) {
tmp = a - 0.3333333333333333;
} else {
tmp = 0.3333333333333333 * (rand * sqrt((a - 0.3333333333333333)));
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: tmp
if (rand <= (-2.1d+92)) then
tmp = (rand / 3.0d0) * sqrt((a + (-0.3333333333333333d0)))
else if (rand <= 1.25d+48) then
tmp = a - 0.3333333333333333d0
else
tmp = 0.3333333333333333d0 * (rand * sqrt((a - 0.3333333333333333d0)))
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if (rand <= -2.1e+92) {
tmp = (rand / 3.0) * Math.sqrt((a + -0.3333333333333333));
} else if (rand <= 1.25e+48) {
tmp = a - 0.3333333333333333;
} else {
tmp = 0.3333333333333333 * (rand * Math.sqrt((a - 0.3333333333333333)));
}
return tmp;
}
def code(a, rand): tmp = 0 if rand <= -2.1e+92: tmp = (rand / 3.0) * math.sqrt((a + -0.3333333333333333)) elif rand <= 1.25e+48: tmp = a - 0.3333333333333333 else: tmp = 0.3333333333333333 * (rand * math.sqrt((a - 0.3333333333333333))) return tmp
function code(a, rand) tmp = 0.0 if (rand <= -2.1e+92) tmp = Float64(Float64(rand / 3.0) * sqrt(Float64(a + -0.3333333333333333))); elseif (rand <= 1.25e+48) tmp = Float64(a - 0.3333333333333333); else tmp = Float64(0.3333333333333333 * Float64(rand * sqrt(Float64(a - 0.3333333333333333)))); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if (rand <= -2.1e+92) tmp = (rand / 3.0) * sqrt((a + -0.3333333333333333)); elseif (rand <= 1.25e+48) tmp = a - 0.3333333333333333; else tmp = 0.3333333333333333 * (rand * sqrt((a - 0.3333333333333333))); end tmp_2 = tmp; end
code[a_, rand_] := If[LessEqual[rand, -2.1e+92], N[(N[(rand / 3.0), $MachinePrecision] * N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 1.25e+48], N[(a - 0.3333333333333333), $MachinePrecision], N[(0.3333333333333333 * N[(rand * N[Sqrt[N[(a - 0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -2.1 \cdot 10^{+92}:\\
\;\;\;\;\frac{rand}{3} \cdot \sqrt{a + -0.3333333333333333}\\
\mathbf{elif}\;rand \leq 1.25 \cdot 10^{+48}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \left(rand \cdot \sqrt{a - 0.3333333333333333}\right)\\
\end{array}
\end{array}
if rand < -2.09999999999999986e92Initial program 98.3%
*-lft-identity98.3%
*-lft-identity98.3%
sub-neg98.3%
metadata-eval98.3%
metadata-eval98.3%
*-commutative98.3%
sub-neg98.3%
metadata-eval98.3%
metadata-eval98.3%
Simplified98.3%
inv-pow98.3%
sqrt-prod99.6%
unpow-prod-down99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
unpow-199.6%
associate-*l/99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in rand around inf 91.8%
associate-*r*91.8%
sub-neg91.8%
metadata-eval91.8%
Simplified91.8%
*-commutative88.2%
metadata-eval88.2%
div-inv88.4%
Applied egg-rr92.2%
if -2.09999999999999986e92 < rand < 1.24999999999999993e48Initial program 100.0%
*-lft-identity100.0%
*-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
associate-*l/100.0%
*-lft-identity100.0%
sub-neg100.0%
distribute-lft-in100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0 95.2%
if 1.24999999999999993e48 < rand Initial program 99.6%
*-lft-identity99.6%
*-lft-identity99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
inv-pow99.6%
sqrt-prod99.6%
unpow-prod-down99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
unpow-199.6%
associate-*l/99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in rand around inf 95.2%
Final simplification94.7%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (sqrt (+ a -0.3333333333333333))))
(if (<= rand -9.6e+92)
(* (/ rand 3.0) t_0)
(if (<= rand 1.15e+48) (- a 0.3333333333333333) (/ t_0 (/ 3.0 rand))))))
double code(double a, double rand) {
double t_0 = sqrt((a + -0.3333333333333333));
double tmp;
if (rand <= -9.6e+92) {
tmp = (rand / 3.0) * t_0;
} else if (rand <= 1.15e+48) {
tmp = a - 0.3333333333333333;
} else {
tmp = t_0 / (3.0 / rand);
}
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 <= (-9.6d+92)) then
tmp = (rand / 3.0d0) * t_0
else if (rand <= 1.15d+48) then
tmp = a - 0.3333333333333333d0
else
tmp = t_0 / (3.0d0 / rand)
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 <= -9.6e+92) {
tmp = (rand / 3.0) * t_0;
} else if (rand <= 1.15e+48) {
tmp = a - 0.3333333333333333;
} else {
tmp = t_0 / (3.0 / rand);
}
return tmp;
}
def code(a, rand): t_0 = math.sqrt((a + -0.3333333333333333)) tmp = 0 if rand <= -9.6e+92: tmp = (rand / 3.0) * t_0 elif rand <= 1.15e+48: tmp = a - 0.3333333333333333 else: tmp = t_0 / (3.0 / rand) return tmp
function code(a, rand) t_0 = sqrt(Float64(a + -0.3333333333333333)) tmp = 0.0 if (rand <= -9.6e+92) tmp = Float64(Float64(rand / 3.0) * t_0); elseif (rand <= 1.15e+48) tmp = Float64(a - 0.3333333333333333); else tmp = Float64(t_0 / Float64(3.0 / rand)); end return tmp end
function tmp_2 = code(a, rand) t_0 = sqrt((a + -0.3333333333333333)); tmp = 0.0; if (rand <= -9.6e+92) tmp = (rand / 3.0) * t_0; elseif (rand <= 1.15e+48) tmp = a - 0.3333333333333333; else tmp = t_0 / (3.0 / rand); end tmp_2 = tmp; end
code[a_, rand_] := Block[{t$95$0 = N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[rand, -9.6e+92], N[(N[(rand / 3.0), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[rand, 1.15e+48], N[(a - 0.3333333333333333), $MachinePrecision], N[(t$95$0 / N[(3.0 / rand), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{a + -0.3333333333333333}\\
\mathbf{if}\;rand \leq -9.6 \cdot 10^{+92}:\\
\;\;\;\;\frac{rand}{3} \cdot t\_0\\
\mathbf{elif}\;rand \leq 1.15 \cdot 10^{+48}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\frac{3}{rand}}\\
\end{array}
\end{array}
if rand < -9.60000000000000018e92Initial program 98.3%
*-lft-identity98.3%
*-lft-identity98.3%
sub-neg98.3%
metadata-eval98.3%
metadata-eval98.3%
*-commutative98.3%
sub-neg98.3%
metadata-eval98.3%
metadata-eval98.3%
Simplified98.3%
inv-pow98.3%
sqrt-prod99.6%
unpow-prod-down99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
unpow-199.6%
associate-*l/99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in rand around inf 91.8%
associate-*r*91.8%
sub-neg91.8%
metadata-eval91.8%
Simplified91.8%
*-commutative88.2%
metadata-eval88.2%
div-inv88.4%
Applied egg-rr92.2%
if -9.60000000000000018e92 < rand < 1.15e48Initial program 100.0%
*-lft-identity100.0%
*-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
associate-*l/100.0%
*-lft-identity100.0%
sub-neg100.0%
distribute-lft-in100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0 95.2%
if 1.15e48 < rand Initial program 99.6%
*-lft-identity99.6%
*-lft-identity99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
inv-pow99.6%
sqrt-prod99.6%
unpow-prod-down99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
unpow-199.6%
associate-*l/99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in rand around inf 95.2%
associate-*r*95.1%
sub-neg95.1%
metadata-eval95.1%
Simplified95.1%
*-commutative95.1%
metadata-eval95.1%
div-inv95.2%
*-commutative95.2%
clear-num95.1%
un-div-inv95.2%
Applied egg-rr95.2%
Final simplification94.7%
(FPCore (a rand) :precision binary64 (if (or (<= rand -1.52e+94) (not (<= rand 1.25e+48))) (* 0.3333333333333333 (* rand (sqrt a))) (- a 0.3333333333333333)))
double code(double a, double rand) {
double tmp;
if ((rand <= -1.52e+94) || !(rand <= 1.25e+48)) {
tmp = 0.3333333333333333 * (rand * sqrt(a));
} 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) :: tmp
if ((rand <= (-1.52d+94)) .or. (.not. (rand <= 1.25d+48))) then
tmp = 0.3333333333333333d0 * (rand * sqrt(a))
else
tmp = a - 0.3333333333333333d0
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if ((rand <= -1.52e+94) || !(rand <= 1.25e+48)) {
tmp = 0.3333333333333333 * (rand * Math.sqrt(a));
} else {
tmp = a - 0.3333333333333333;
}
return tmp;
}
def code(a, rand): tmp = 0 if (rand <= -1.52e+94) or not (rand <= 1.25e+48): tmp = 0.3333333333333333 * (rand * math.sqrt(a)) else: tmp = a - 0.3333333333333333 return tmp
function code(a, rand) tmp = 0.0 if ((rand <= -1.52e+94) || !(rand <= 1.25e+48)) tmp = Float64(0.3333333333333333 * Float64(rand * sqrt(a))); else tmp = Float64(a - 0.3333333333333333); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if ((rand <= -1.52e+94) || ~((rand <= 1.25e+48))) tmp = 0.3333333333333333 * (rand * sqrt(a)); else tmp = a - 0.3333333333333333; end tmp_2 = tmp; end
code[a_, rand_] := If[Or[LessEqual[rand, -1.52e+94], N[Not[LessEqual[rand, 1.25e+48]], $MachinePrecision]], N[(0.3333333333333333 * N[(rand * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a - 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -1.52 \cdot 10^{+94} \lor \neg \left(rand \leq 1.25 \cdot 10^{+48}\right):\\
\;\;\;\;0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)\\
\mathbf{else}:\\
\;\;\;\;a - 0.3333333333333333\\
\end{array}
\end{array}
if rand < -1.5199999999999999e94 or 1.24999999999999993e48 < rand Initial program 99.0%
*-lft-identity99.0%
*-lft-identity99.0%
sub-neg99.0%
metadata-eval99.0%
metadata-eval99.0%
associate-*l/99.0%
*-lft-identity99.0%
sub-neg99.0%
distribute-lft-in99.0%
metadata-eval99.0%
metadata-eval99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in rand around inf 75.9%
Taylor expanded in a around inf 90.2%
if -1.5199999999999999e94 < rand < 1.24999999999999993e48Initial program 100.0%
*-lft-identity100.0%
*-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
associate-*l/100.0%
*-lft-identity100.0%
sub-neg100.0%
distribute-lft-in100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0 95.2%
Final simplification93.5%
(FPCore (a rand) :precision binary64 (if (or (<= rand -1.35e+92) (not (<= rand 1.25e+48))) (* rand (sqrt (* a 0.1111111111111111))) (- a 0.3333333333333333)))
double code(double a, double rand) {
double tmp;
if ((rand <= -1.35e+92) || !(rand <= 1.25e+48)) {
tmp = rand * sqrt((a * 0.1111111111111111));
} 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) :: tmp
if ((rand <= (-1.35d+92)) .or. (.not. (rand <= 1.25d+48))) then
tmp = rand * sqrt((a * 0.1111111111111111d0))
else
tmp = a - 0.3333333333333333d0
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if ((rand <= -1.35e+92) || !(rand <= 1.25e+48)) {
tmp = rand * Math.sqrt((a * 0.1111111111111111));
} else {
tmp = a - 0.3333333333333333;
}
return tmp;
}
def code(a, rand): tmp = 0 if (rand <= -1.35e+92) or not (rand <= 1.25e+48): tmp = rand * math.sqrt((a * 0.1111111111111111)) else: tmp = a - 0.3333333333333333 return tmp
function code(a, rand) tmp = 0.0 if ((rand <= -1.35e+92) || !(rand <= 1.25e+48)) tmp = Float64(rand * sqrt(Float64(a * 0.1111111111111111))); else tmp = Float64(a - 0.3333333333333333); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if ((rand <= -1.35e+92) || ~((rand <= 1.25e+48))) tmp = rand * sqrt((a * 0.1111111111111111)); else tmp = a - 0.3333333333333333; end tmp_2 = tmp; end
code[a_, rand_] := If[Or[LessEqual[rand, -1.35e+92], N[Not[LessEqual[rand, 1.25e+48]], $MachinePrecision]], N[(rand * N[Sqrt[N[(a * 0.1111111111111111), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(a - 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -1.35 \cdot 10^{+92} \lor \neg \left(rand \leq 1.25 \cdot 10^{+48}\right):\\
\;\;\;\;rand \cdot \sqrt{a \cdot 0.1111111111111111}\\
\mathbf{else}:\\
\;\;\;\;a - 0.3333333333333333\\
\end{array}
\end{array}
if rand < -1.35e92 or 1.24999999999999993e48 < rand Initial program 99.0%
*-lft-identity99.0%
*-lft-identity99.0%
sub-neg99.0%
metadata-eval99.0%
metadata-eval99.0%
*-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
metadata-eval99.0%
Simplified99.0%
inv-pow99.0%
sqrt-prod99.6%
unpow-prod-down99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
unpow-199.6%
associate-*l/99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in rand around inf 93.6%
associate-*r*93.5%
sub-neg93.5%
metadata-eval93.5%
Simplified93.5%
Taylor expanded in a around inf 90.2%
*-commutative90.2%
*-commutative90.2%
associate-*r*90.2%
*-commutative90.2%
Simplified90.2%
add-sqr-sqrt90.1%
sqrt-unprod90.2%
*-commutative90.2%
*-commutative90.2%
swap-sqr90.3%
add-sqr-sqrt90.3%
metadata-eval90.3%
Applied egg-rr90.3%
if -1.35e92 < rand < 1.24999999999999993e48Initial program 100.0%
*-lft-identity100.0%
*-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
associate-*l/100.0%
*-lft-identity100.0%
sub-neg100.0%
distribute-lft-in100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0 95.2%
Final simplification93.5%
(FPCore (a rand) :precision binary64 (if (or (<= rand -7e+94) (not (<= rand 1.25e+48))) (* (/ rand 3.0) (sqrt a)) (- a 0.3333333333333333)))
double code(double a, double rand) {
double tmp;
if ((rand <= -7e+94) || !(rand <= 1.25e+48)) {
tmp = (rand / 3.0) * sqrt(a);
} 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) :: tmp
if ((rand <= (-7d+94)) .or. (.not. (rand <= 1.25d+48))) then
tmp = (rand / 3.0d0) * sqrt(a)
else
tmp = a - 0.3333333333333333d0
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if ((rand <= -7e+94) || !(rand <= 1.25e+48)) {
tmp = (rand / 3.0) * Math.sqrt(a);
} else {
tmp = a - 0.3333333333333333;
}
return tmp;
}
def code(a, rand): tmp = 0 if (rand <= -7e+94) or not (rand <= 1.25e+48): tmp = (rand / 3.0) * math.sqrt(a) else: tmp = a - 0.3333333333333333 return tmp
function code(a, rand) tmp = 0.0 if ((rand <= -7e+94) || !(rand <= 1.25e+48)) tmp = Float64(Float64(rand / 3.0) * sqrt(a)); else tmp = Float64(a - 0.3333333333333333); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if ((rand <= -7e+94) || ~((rand <= 1.25e+48))) tmp = (rand / 3.0) * sqrt(a); else tmp = a - 0.3333333333333333; end tmp_2 = tmp; end
code[a_, rand_] := If[Or[LessEqual[rand, -7e+94], N[Not[LessEqual[rand, 1.25e+48]], $MachinePrecision]], N[(N[(rand / 3.0), $MachinePrecision] * N[Sqrt[a], $MachinePrecision]), $MachinePrecision], N[(a - 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -7 \cdot 10^{+94} \lor \neg \left(rand \leq 1.25 \cdot 10^{+48}\right):\\
\;\;\;\;\frac{rand}{3} \cdot \sqrt{a}\\
\mathbf{else}:\\
\;\;\;\;a - 0.3333333333333333\\
\end{array}
\end{array}
if rand < -6.9999999999999994e94 or 1.24999999999999993e48 < rand Initial program 99.0%
*-lft-identity99.0%
*-lft-identity99.0%
sub-neg99.0%
metadata-eval99.0%
metadata-eval99.0%
*-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
metadata-eval99.0%
Simplified99.0%
inv-pow99.0%
sqrt-prod99.6%
unpow-prod-down99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
unpow-199.6%
associate-*l/99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in rand around inf 93.6%
associate-*r*93.5%
sub-neg93.5%
metadata-eval93.5%
Simplified93.5%
Taylor expanded in a around inf 90.2%
*-commutative90.2%
metadata-eval90.2%
div-inv90.4%
Applied egg-rr90.4%
if -6.9999999999999994e94 < rand < 1.24999999999999993e48Initial program 100.0%
*-lft-identity100.0%
*-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
associate-*l/100.0%
*-lft-identity100.0%
sub-neg100.0%
distribute-lft-in100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0 95.2%
Final simplification93.5%
(FPCore (a rand)
:precision binary64
(if (<= rand -1.45e+92)
(* rand (sqrt (* a 0.1111111111111111)))
(if (<= rand 1.15e+48)
(- a 0.3333333333333333)
(* rand (* 0.3333333333333333 (sqrt a))))))
double code(double a, double rand) {
double tmp;
if (rand <= -1.45e+92) {
tmp = rand * sqrt((a * 0.1111111111111111));
} else if (rand <= 1.15e+48) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand * (0.3333333333333333 * sqrt(a));
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: tmp
if (rand <= (-1.45d+92)) then
tmp = rand * sqrt((a * 0.1111111111111111d0))
else if (rand <= 1.15d+48) then
tmp = a - 0.3333333333333333d0
else
tmp = rand * (0.3333333333333333d0 * sqrt(a))
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if (rand <= -1.45e+92) {
tmp = rand * Math.sqrt((a * 0.1111111111111111));
} else if (rand <= 1.15e+48) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand * (0.3333333333333333 * Math.sqrt(a));
}
return tmp;
}
def code(a, rand): tmp = 0 if rand <= -1.45e+92: tmp = rand * math.sqrt((a * 0.1111111111111111)) elif rand <= 1.15e+48: tmp = a - 0.3333333333333333 else: tmp = rand * (0.3333333333333333 * math.sqrt(a)) return tmp
function code(a, rand) tmp = 0.0 if (rand <= -1.45e+92) tmp = Float64(rand * sqrt(Float64(a * 0.1111111111111111))); elseif (rand <= 1.15e+48) tmp = Float64(a - 0.3333333333333333); else tmp = Float64(rand * Float64(0.3333333333333333 * sqrt(a))); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if (rand <= -1.45e+92) tmp = rand * sqrt((a * 0.1111111111111111)); elseif (rand <= 1.15e+48) tmp = a - 0.3333333333333333; else tmp = rand * (0.3333333333333333 * sqrt(a)); end tmp_2 = tmp; end
code[a_, rand_] := If[LessEqual[rand, -1.45e+92], N[(rand * N[Sqrt[N[(a * 0.1111111111111111), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 1.15e+48], N[(a - 0.3333333333333333), $MachinePrecision], N[(rand * N[(0.3333333333333333 * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -1.45 \cdot 10^{+92}:\\
\;\;\;\;rand \cdot \sqrt{a \cdot 0.1111111111111111}\\
\mathbf{elif}\;rand \leq 1.15 \cdot 10^{+48}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;rand \cdot \left(0.3333333333333333 \cdot \sqrt{a}\right)\\
\end{array}
\end{array}
if rand < -1.45e92Initial program 98.3%
*-lft-identity98.3%
*-lft-identity98.3%
sub-neg98.3%
metadata-eval98.3%
metadata-eval98.3%
*-commutative98.3%
sub-neg98.3%
metadata-eval98.3%
metadata-eval98.3%
Simplified98.3%
inv-pow98.3%
sqrt-prod99.6%
unpow-prod-down99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
unpow-199.6%
associate-*l/99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in rand around inf 91.8%
associate-*r*91.8%
sub-neg91.8%
metadata-eval91.8%
Simplified91.8%
Taylor expanded in a around inf 88.2%
*-commutative88.2%
*-commutative88.2%
associate-*r*88.2%
*-commutative88.2%
Simplified88.2%
add-sqr-sqrt88.1%
sqrt-unprod88.2%
*-commutative88.2%
*-commutative88.2%
swap-sqr88.3%
add-sqr-sqrt88.4%
metadata-eval88.4%
Applied egg-rr88.4%
if -1.45e92 < rand < 1.15e48Initial program 100.0%
*-lft-identity100.0%
*-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
associate-*l/100.0%
*-lft-identity100.0%
sub-neg100.0%
distribute-lft-in100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0 95.2%
if 1.15e48 < rand Initial program 99.6%
*-lft-identity99.6%
*-lft-identity99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
inv-pow99.6%
sqrt-prod99.6%
unpow-prod-down99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
unpow-199.6%
associate-*l/99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in rand around inf 95.2%
associate-*r*95.1%
sub-neg95.1%
metadata-eval95.1%
Simplified95.1%
Taylor expanded in a around inf 92.1%
*-commutative92.1%
*-commutative92.1%
associate-*r*92.1%
*-commutative92.1%
Simplified92.1%
Final simplification93.5%
(FPCore (a rand) :precision binary64 (if (<= rand -1.66e+96) (* (/ rand 3.0) (sqrt a)) (if (<= rand 1.25e+48) (- a 0.3333333333333333) (/ (sqrt a) (/ 3.0 rand)))))
double code(double a, double rand) {
double tmp;
if (rand <= -1.66e+96) {
tmp = (rand / 3.0) * sqrt(a);
} else if (rand <= 1.25e+48) {
tmp = a - 0.3333333333333333;
} else {
tmp = sqrt(a) / (3.0 / rand);
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: tmp
if (rand <= (-1.66d+96)) then
tmp = (rand / 3.0d0) * sqrt(a)
else if (rand <= 1.25d+48) then
tmp = a - 0.3333333333333333d0
else
tmp = sqrt(a) / (3.0d0 / rand)
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if (rand <= -1.66e+96) {
tmp = (rand / 3.0) * Math.sqrt(a);
} else if (rand <= 1.25e+48) {
tmp = a - 0.3333333333333333;
} else {
tmp = Math.sqrt(a) / (3.0 / rand);
}
return tmp;
}
def code(a, rand): tmp = 0 if rand <= -1.66e+96: tmp = (rand / 3.0) * math.sqrt(a) elif rand <= 1.25e+48: tmp = a - 0.3333333333333333 else: tmp = math.sqrt(a) / (3.0 / rand) return tmp
function code(a, rand) tmp = 0.0 if (rand <= -1.66e+96) tmp = Float64(Float64(rand / 3.0) * sqrt(a)); elseif (rand <= 1.25e+48) tmp = Float64(a - 0.3333333333333333); else tmp = Float64(sqrt(a) / Float64(3.0 / rand)); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if (rand <= -1.66e+96) tmp = (rand / 3.0) * sqrt(a); elseif (rand <= 1.25e+48) tmp = a - 0.3333333333333333; else tmp = sqrt(a) / (3.0 / rand); end tmp_2 = tmp; end
code[a_, rand_] := If[LessEqual[rand, -1.66e+96], N[(N[(rand / 3.0), $MachinePrecision] * N[Sqrt[a], $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 1.25e+48], N[(a - 0.3333333333333333), $MachinePrecision], N[(N[Sqrt[a], $MachinePrecision] / N[(3.0 / rand), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -1.66 \cdot 10^{+96}:\\
\;\;\;\;\frac{rand}{3} \cdot \sqrt{a}\\
\mathbf{elif}\;rand \leq 1.25 \cdot 10^{+48}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{a}}{\frac{3}{rand}}\\
\end{array}
\end{array}
if rand < -1.6599999999999999e96Initial program 98.3%
*-lft-identity98.3%
*-lft-identity98.3%
sub-neg98.3%
metadata-eval98.3%
metadata-eval98.3%
*-commutative98.3%
sub-neg98.3%
metadata-eval98.3%
metadata-eval98.3%
Simplified98.3%
inv-pow98.3%
sqrt-prod99.6%
unpow-prod-down99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
unpow-199.6%
associate-*l/99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in rand around inf 91.8%
associate-*r*91.8%
sub-neg91.8%
metadata-eval91.8%
Simplified91.8%
Taylor expanded in a around inf 88.2%
*-commutative88.2%
metadata-eval88.2%
div-inv88.4%
Applied egg-rr88.4%
if -1.6599999999999999e96 < rand < 1.24999999999999993e48Initial program 100.0%
*-lft-identity100.0%
*-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
associate-*l/100.0%
*-lft-identity100.0%
sub-neg100.0%
distribute-lft-in100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0 95.2%
if 1.24999999999999993e48 < rand Initial program 99.6%
*-lft-identity99.6%
*-lft-identity99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
inv-pow99.6%
sqrt-prod99.6%
unpow-prod-down99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
unpow-199.6%
associate-*l/99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in rand around inf 95.2%
associate-*r*95.1%
sub-neg95.1%
metadata-eval95.1%
Simplified95.1%
Taylor expanded in a around inf 92.1%
*-commutative92.1%
*-commutative92.1%
associate-*r*92.1%
*-commutative92.1%
Simplified92.1%
associate-*r*92.1%
metadata-eval92.1%
div-inv92.1%
*-commutative92.1%
clear-num92.0%
un-div-inv92.1%
Applied egg-rr92.1%
Final simplification93.5%
(FPCore (a rand) :precision binary64 (if (<= rand -1.26e+94) (/ (* rand (sqrt a)) 3.0) (if (<= rand 1.15e+48) (- a 0.3333333333333333) (/ (sqrt a) (/ 3.0 rand)))))
double code(double a, double rand) {
double tmp;
if (rand <= -1.26e+94) {
tmp = (rand * sqrt(a)) / 3.0;
} else if (rand <= 1.15e+48) {
tmp = a - 0.3333333333333333;
} else {
tmp = sqrt(a) / (3.0 / rand);
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: tmp
if (rand <= (-1.26d+94)) then
tmp = (rand * sqrt(a)) / 3.0d0
else if (rand <= 1.15d+48) then
tmp = a - 0.3333333333333333d0
else
tmp = sqrt(a) / (3.0d0 / rand)
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if (rand <= -1.26e+94) {
tmp = (rand * Math.sqrt(a)) / 3.0;
} else if (rand <= 1.15e+48) {
tmp = a - 0.3333333333333333;
} else {
tmp = Math.sqrt(a) / (3.0 / rand);
}
return tmp;
}
def code(a, rand): tmp = 0 if rand <= -1.26e+94: tmp = (rand * math.sqrt(a)) / 3.0 elif rand <= 1.15e+48: tmp = a - 0.3333333333333333 else: tmp = math.sqrt(a) / (3.0 / rand) return tmp
function code(a, rand) tmp = 0.0 if (rand <= -1.26e+94) tmp = Float64(Float64(rand * sqrt(a)) / 3.0); elseif (rand <= 1.15e+48) tmp = Float64(a - 0.3333333333333333); else tmp = Float64(sqrt(a) / Float64(3.0 / rand)); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if (rand <= -1.26e+94) tmp = (rand * sqrt(a)) / 3.0; elseif (rand <= 1.15e+48) tmp = a - 0.3333333333333333; else tmp = sqrt(a) / (3.0 / rand); end tmp_2 = tmp; end
code[a_, rand_] := If[LessEqual[rand, -1.26e+94], N[(N[(rand * N[Sqrt[a], $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision], If[LessEqual[rand, 1.15e+48], N[(a - 0.3333333333333333), $MachinePrecision], N[(N[Sqrt[a], $MachinePrecision] / N[(3.0 / rand), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -1.26 \cdot 10^{+94}:\\
\;\;\;\;\frac{rand \cdot \sqrt{a}}{3}\\
\mathbf{elif}\;rand \leq 1.15 \cdot 10^{+48}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{a}}{\frac{3}{rand}}\\
\end{array}
\end{array}
if rand < -1.25999999999999997e94Initial program 98.3%
*-lft-identity98.3%
*-lft-identity98.3%
sub-neg98.3%
metadata-eval98.3%
metadata-eval98.3%
*-commutative98.3%
sub-neg98.3%
metadata-eval98.3%
metadata-eval98.3%
Simplified98.3%
inv-pow98.3%
sqrt-prod99.6%
unpow-prod-down99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
unpow-199.6%
associate-*l/99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in rand around inf 91.8%
associate-*r*91.8%
sub-neg91.8%
metadata-eval91.8%
Simplified91.8%
Taylor expanded in a around inf 88.2%
*-commutative88.2%
*-commutative88.2%
associate-*r*88.2%
*-commutative88.2%
Simplified88.2%
associate-*r*88.2%
metadata-eval88.2%
div-inv88.4%
associate-*l/88.4%
Applied egg-rr88.4%
if -1.25999999999999997e94 < rand < 1.15e48Initial program 100.0%
*-lft-identity100.0%
*-lft-identity100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
associate-*l/100.0%
*-lft-identity100.0%
sub-neg100.0%
distribute-lft-in100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0 95.2%
if 1.15e48 < rand Initial program 99.6%
*-lft-identity99.6%
*-lft-identity99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
inv-pow99.6%
sqrt-prod99.6%
unpow-prod-down99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
unpow-199.6%
associate-*l/99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in rand around inf 95.2%
associate-*r*95.1%
sub-neg95.1%
metadata-eval95.1%
Simplified95.1%
Taylor expanded in a around inf 92.1%
*-commutative92.1%
*-commutative92.1%
associate-*r*92.1%
*-commutative92.1%
Simplified92.1%
associate-*r*92.1%
metadata-eval92.1%
div-inv92.1%
*-commutative92.1%
clear-num92.0%
un-div-inv92.1%
Applied egg-rr92.1%
Final simplification93.5%
(FPCore (a rand) :precision binary64 (* (+ a -0.3333333333333333) (+ 1.0 (* rand (* 0.3333333333333333 (sqrt (/ 1.0 a)))))))
double code(double a, double rand) {
return (a + -0.3333333333333333) * (1.0 + (rand * (0.3333333333333333 * sqrt((1.0 / a)))));
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = (a + (-0.3333333333333333d0)) * (1.0d0 + (rand * (0.3333333333333333d0 * sqrt((1.0d0 / a)))))
end function
public static double code(double a, double rand) {
return (a + -0.3333333333333333) * (1.0 + (rand * (0.3333333333333333 * Math.sqrt((1.0 / a)))));
}
def code(a, rand): return (a + -0.3333333333333333) * (1.0 + (rand * (0.3333333333333333 * math.sqrt((1.0 / a)))))
function code(a, rand) return Float64(Float64(a + -0.3333333333333333) * Float64(1.0 + Float64(rand * Float64(0.3333333333333333 * sqrt(Float64(1.0 / a)))))) end
function tmp = code(a, rand) tmp = (a + -0.3333333333333333) * (1.0 + (rand * (0.3333333333333333 * sqrt((1.0 / a))))); end
code[a_, rand_] := N[(N[(a + -0.3333333333333333), $MachinePrecision] * N[(1.0 + N[(rand * N[(0.3333333333333333 * N[Sqrt[N[(1.0 / a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a + -0.3333333333333333\right) \cdot \left(1 + rand \cdot \left(0.3333333333333333 \cdot \sqrt{\frac{1}{a}}\right)\right)
\end{array}
Initial program 99.6%
*-lft-identity99.6%
*-lft-identity99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around inf 98.6%
*-commutative98.6%
Simplified98.6%
Final simplification98.6%
(FPCore (a rand) :precision binary64 (* (+ a -0.3333333333333333) (+ 1.0 (/ (/ rand 3.0) (sqrt a)))))
double code(double a, double rand) {
return (a + -0.3333333333333333) * (1.0 + ((rand / 3.0) / sqrt(a)));
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = (a + (-0.3333333333333333d0)) * (1.0d0 + ((rand / 3.0d0) / sqrt(a)))
end function
public static double code(double a, double rand) {
return (a + -0.3333333333333333) * (1.0 + ((rand / 3.0) / Math.sqrt(a)));
}
def code(a, rand): return (a + -0.3333333333333333) * (1.0 + ((rand / 3.0) / math.sqrt(a)))
function code(a, rand) return Float64(Float64(a + -0.3333333333333333) * Float64(1.0 + Float64(Float64(rand / 3.0) / sqrt(a)))) end
function tmp = code(a, rand) tmp = (a + -0.3333333333333333) * (1.0 + ((rand / 3.0) / sqrt(a))); end
code[a_, rand_] := N[(N[(a + -0.3333333333333333), $MachinePrecision] * N[(1.0 + N[(N[(rand / 3.0), $MachinePrecision] / N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{\frac{rand}{3}}{\sqrt{a}}\right)
\end{array}
Initial program 99.6%
*-lft-identity99.6%
*-lft-identity99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around inf 98.5%
associate-*l/98.5%
*-un-lft-identity98.5%
associate-/r*98.5%
Applied egg-rr98.5%
Final simplification98.5%
(FPCore (a rand) :precision binary64 (- (+ a (* 0.3333333333333333 (* rand (sqrt a)))) 0.3333333333333333))
double code(double a, double rand) {
return (a + (0.3333333333333333 * (rand * sqrt(a)))) - 0.3333333333333333;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = (a + (0.3333333333333333d0 * (rand * sqrt(a)))) - 0.3333333333333333d0
end function
public static double code(double a, double rand) {
return (a + (0.3333333333333333 * (rand * Math.sqrt(a)))) - 0.3333333333333333;
}
def code(a, rand): return (a + (0.3333333333333333 * (rand * math.sqrt(a)))) - 0.3333333333333333
function code(a, rand) return Float64(Float64(a + Float64(0.3333333333333333 * Float64(rand * sqrt(a)))) - 0.3333333333333333) end
function tmp = code(a, rand) tmp = (a + (0.3333333333333333 * (rand * sqrt(a)))) - 0.3333333333333333; end
code[a_, rand_] := N[(N[(a + N[(0.3333333333333333 * N[(rand * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision]
\begin{array}{l}
\\
\left(a + 0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)\right) - 0.3333333333333333
\end{array}
Initial program 99.6%
*-lft-identity99.6%
*-lft-identity99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
associate-*l/99.6%
*-lft-identity99.6%
sub-neg99.6%
distribute-lft-in99.6%
metadata-eval99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in rand around 0 91.5%
Taylor expanded in a around inf 98.5%
Final simplification98.5%
(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.6%
*-lft-identity99.6%
*-lft-identity99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
associate-*l/99.6%
*-lft-identity99.6%
sub-neg99.6%
distribute-lft-in99.6%
metadata-eval99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in rand around 0 64.8%
Final simplification64.8%
herbie shell --seed 2024080
(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))))