
(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 16 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 (+ -0.3333333333333333 (fma (* 0.3333333333333333 rand) (sqrt (+ a -0.3333333333333333)) a)))
double code(double a, double rand) {
return -0.3333333333333333 + fma((0.3333333333333333 * rand), sqrt((a + -0.3333333333333333)), a);
}
function code(a, rand) return Float64(-0.3333333333333333 + fma(Float64(0.3333333333333333 * rand), sqrt(Float64(a + -0.3333333333333333)), a)) end
code[a_, rand_] := N[(-0.3333333333333333 + N[(N[(0.3333333333333333 * rand), $MachinePrecision] * N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.3333333333333333 + \mathsf{fma}\left(0.3333333333333333 \cdot rand, \sqrt{a + -0.3333333333333333}, a\right)
\end{array}
Initial program 99.8%
*-lft-identity99.8%
*-lft-identity99.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.5%
sub-neg99.5%
+-commutative99.5%
associate-*r*99.8%
sub-neg99.8%
metadata-eval99.8%
fma-define99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (a rand) :precision binary64 (if (or (<= rand -7.5e+82) (not (<= rand 4.3e+101))) (* 0.3333333333333333 (* rand (sqrt (- a 0.3333333333333333)))) (- a 0.3333333333333333)))
double code(double a, double rand) {
double tmp;
if ((rand <= -7.5e+82) || !(rand <= 4.3e+101)) {
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 <= (-7.5d+82)) .or. (.not. (rand <= 4.3d+101))) 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 <= -7.5e+82) || !(rand <= 4.3e+101)) {
tmp = 0.3333333333333333 * (rand * Math.sqrt((a - 0.3333333333333333)));
} else {
tmp = a - 0.3333333333333333;
}
return tmp;
}
def code(a, rand): tmp = 0 if (rand <= -7.5e+82) or not (rand <= 4.3e+101): 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 <= -7.5e+82) || !(rand <= 4.3e+101)) 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 <= -7.5e+82) || ~((rand <= 4.3e+101))) 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, -7.5e+82], N[Not[LessEqual[rand, 4.3e+101]], $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 -7.5 \cdot 10^{+82} \lor \neg \left(rand \leq 4.3 \cdot 10^{+101}\right):\\
\;\;\;\;0.3333333333333333 \cdot \left(rand \cdot \sqrt{a - 0.3333333333333333}\right)\\
\mathbf{else}:\\
\;\;\;\;a - 0.3333333333333333\\
\end{array}
\end{array}
if rand < -7.4999999999999999e82 or 4.3000000000000001e101 < 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%
Taylor expanded in rand around inf 94.0%
if -7.4999999999999999e82 < rand < 4.3000000000000001e101Initial program 99.9%
*-lft-identity99.9%
*-lft-identity99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in rand around 0 93.7%
Final simplification93.8%
(FPCore (a rand) :precision binary64 (if (or (<= rand -3.6e+83) (not (<= rand 3.8e+101))) (* rand (sqrt (+ -0.037037037037037035 (* a 0.1111111111111111)))) (- a 0.3333333333333333)))
double code(double a, double rand) {
double tmp;
if ((rand <= -3.6e+83) || !(rand <= 3.8e+101)) {
tmp = rand * sqrt((-0.037037037037037035 + (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 <= (-3.6d+83)) .or. (.not. (rand <= 3.8d+101))) then
tmp = rand * sqrt(((-0.037037037037037035d0) + (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 <= -3.6e+83) || !(rand <= 3.8e+101)) {
tmp = rand * Math.sqrt((-0.037037037037037035 + (a * 0.1111111111111111)));
} else {
tmp = a - 0.3333333333333333;
}
return tmp;
}
def code(a, rand): tmp = 0 if (rand <= -3.6e+83) or not (rand <= 3.8e+101): tmp = rand * math.sqrt((-0.037037037037037035 + (a * 0.1111111111111111))) else: tmp = a - 0.3333333333333333 return tmp
function code(a, rand) tmp = 0.0 if ((rand <= -3.6e+83) || !(rand <= 3.8e+101)) tmp = Float64(rand * sqrt(Float64(-0.037037037037037035 + 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 <= -3.6e+83) || ~((rand <= 3.8e+101))) tmp = rand * sqrt((-0.037037037037037035 + (a * 0.1111111111111111))); else tmp = a - 0.3333333333333333; end tmp_2 = tmp; end
code[a_, rand_] := If[Or[LessEqual[rand, -3.6e+83], N[Not[LessEqual[rand, 3.8e+101]], $MachinePrecision]], N[(rand * N[Sqrt[N[(-0.037037037037037035 + N[(a * 0.1111111111111111), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(a - 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -3.6 \cdot 10^{+83} \lor \neg \left(rand \leq 3.8 \cdot 10^{+101}\right):\\
\;\;\;\;rand \cdot \sqrt{-0.037037037037037035 + a \cdot 0.1111111111111111}\\
\mathbf{else}:\\
\;\;\;\;a - 0.3333333333333333\\
\end{array}
\end{array}
if rand < -3.5999999999999997e83 or 3.7999999999999998e101 < 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%
Taylor expanded in rand around inf 94.0%
*-commutative94.0%
sub-neg94.0%
metadata-eval94.0%
associate-*l*94.1%
metadata-eval94.1%
sub-neg94.1%
*-commutative94.1%
sub-neg94.1%
metadata-eval94.1%
Simplified94.1%
add-sqr-sqrt93.9%
sqrt-unprod94.1%
*-commutative94.1%
*-commutative94.1%
swap-sqr94.2%
add-sqr-sqrt94.3%
metadata-eval94.3%
Applied egg-rr94.3%
*-commutative94.3%
+-commutative94.3%
distribute-rgt-in94.3%
metadata-eval94.3%
Simplified94.3%
if -3.5999999999999997e83 < rand < 3.7999999999999998e101Initial program 99.9%
*-lft-identity99.9%
*-lft-identity99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in rand around 0 93.7%
Final simplification93.9%
(FPCore (a rand)
:precision binary64
(if (<= rand -8e+83)
(* rand (/ (sqrt (+ a -0.3333333333333333)) 3.0))
(if (<= rand 3.4e+101)
(- a 0.3333333333333333)
(* rand (sqrt (+ -0.037037037037037035 (* a 0.1111111111111111)))))))
double code(double a, double rand) {
double tmp;
if (rand <= -8e+83) {
tmp = rand * (sqrt((a + -0.3333333333333333)) / 3.0);
} else if (rand <= 3.4e+101) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand * sqrt((-0.037037037037037035 + (a * 0.1111111111111111)));
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: tmp
if (rand <= (-8d+83)) then
tmp = rand * (sqrt((a + (-0.3333333333333333d0))) / 3.0d0)
else if (rand <= 3.4d+101) then
tmp = a - 0.3333333333333333d0
else
tmp = rand * sqrt(((-0.037037037037037035d0) + (a * 0.1111111111111111d0)))
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if (rand <= -8e+83) {
tmp = rand * (Math.sqrt((a + -0.3333333333333333)) / 3.0);
} else if (rand <= 3.4e+101) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand * Math.sqrt((-0.037037037037037035 + (a * 0.1111111111111111)));
}
return tmp;
}
def code(a, rand): tmp = 0 if rand <= -8e+83: tmp = rand * (math.sqrt((a + -0.3333333333333333)) / 3.0) elif rand <= 3.4e+101: tmp = a - 0.3333333333333333 else: tmp = rand * math.sqrt((-0.037037037037037035 + (a * 0.1111111111111111))) return tmp
function code(a, rand) tmp = 0.0 if (rand <= -8e+83) tmp = Float64(rand * Float64(sqrt(Float64(a + -0.3333333333333333)) / 3.0)); elseif (rand <= 3.4e+101) tmp = Float64(a - 0.3333333333333333); else tmp = Float64(rand * sqrt(Float64(-0.037037037037037035 + Float64(a * 0.1111111111111111)))); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if (rand <= -8e+83) tmp = rand * (sqrt((a + -0.3333333333333333)) / 3.0); elseif (rand <= 3.4e+101) tmp = a - 0.3333333333333333; else tmp = rand * sqrt((-0.037037037037037035 + (a * 0.1111111111111111))); end tmp_2 = tmp; end
code[a_, rand_] := If[LessEqual[rand, -8e+83], N[(rand * N[(N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 3.4e+101], N[(a - 0.3333333333333333), $MachinePrecision], N[(rand * N[Sqrt[N[(-0.037037037037037035 + N[(a * 0.1111111111111111), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -8 \cdot 10^{+83}:\\
\;\;\;\;rand \cdot \frac{\sqrt{a + -0.3333333333333333}}{3}\\
\mathbf{elif}\;rand \leq 3.4 \cdot 10^{+101}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;rand \cdot \sqrt{-0.037037037037037035 + a \cdot 0.1111111111111111}\\
\end{array}
\end{array}
if rand < -8.00000000000000025e83Initial program 99.4%
*-lft-identity99.4%
*-lft-identity99.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 92.8%
*-commutative92.8%
sub-neg92.8%
metadata-eval92.8%
associate-*l*93.0%
metadata-eval93.0%
sub-neg93.0%
*-commutative93.0%
sub-neg93.0%
metadata-eval93.0%
Simplified93.0%
associate-*r*93.3%
metadata-eval93.3%
div-inv93.2%
associate-*l/93.0%
Applied egg-rr93.0%
associate-/l*93.3%
Simplified93.3%
if -8.00000000000000025e83 < rand < 3.40000000000000017e101Initial program 99.9%
*-lft-identity99.9%
*-lft-identity99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in rand around 0 93.7%
if 3.40000000000000017e101 < rand Initial program 99.7%
*-lft-identity99.7%
*-lft-identity99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in rand around inf 95.6%
*-commutative95.6%
sub-neg95.6%
metadata-eval95.6%
associate-*l*95.6%
metadata-eval95.6%
sub-neg95.6%
*-commutative95.6%
sub-neg95.6%
metadata-eval95.6%
Simplified95.6%
add-sqr-sqrt95.4%
sqrt-unprod95.6%
*-commutative95.6%
*-commutative95.6%
swap-sqr95.7%
add-sqr-sqrt95.7%
metadata-eval95.7%
Applied egg-rr95.7%
*-commutative95.7%
+-commutative95.7%
distribute-rgt-in95.7%
metadata-eval95.7%
Simplified95.7%
Final simplification93.9%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (sqrt (+ a -0.3333333333333333))))
(if (<= rand -4.8e+83)
(* rand (/ t_0 3.0))
(if (<= rand 3.9e+101) (- 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 <= -4.8e+83) {
tmp = rand * (t_0 / 3.0);
} else if (rand <= 3.9e+101) {
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 <= (-4.8d+83)) then
tmp = rand * (t_0 / 3.0d0)
else if (rand <= 3.9d+101) 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 <= -4.8e+83) {
tmp = rand * (t_0 / 3.0);
} else if (rand <= 3.9e+101) {
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 <= -4.8e+83: tmp = rand * (t_0 / 3.0) elif rand <= 3.9e+101: 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 <= -4.8e+83) tmp = Float64(rand * Float64(t_0 / 3.0)); elseif (rand <= 3.9e+101) 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 <= -4.8e+83) tmp = rand * (t_0 / 3.0); elseif (rand <= 3.9e+101) 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, -4.8e+83], N[(rand * N[(t$95$0 / 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 3.9e+101], 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 -4.8 \cdot 10^{+83}:\\
\;\;\;\;rand \cdot \frac{t\_0}{3}\\
\mathbf{elif}\;rand \leq 3.9 \cdot 10^{+101}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{rand \cdot t\_0}{3}\\
\end{array}
\end{array}
if rand < -4.79999999999999982e83Initial program 99.4%
*-lft-identity99.4%
*-lft-identity99.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 92.8%
*-commutative92.8%
sub-neg92.8%
metadata-eval92.8%
associate-*l*93.0%
metadata-eval93.0%
sub-neg93.0%
*-commutative93.0%
sub-neg93.0%
metadata-eval93.0%
Simplified93.0%
associate-*r*93.3%
metadata-eval93.3%
div-inv93.2%
associate-*l/93.0%
Applied egg-rr93.0%
associate-/l*93.3%
Simplified93.3%
if -4.79999999999999982e83 < rand < 3.9e101Initial program 99.9%
*-lft-identity99.9%
*-lft-identity99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in rand around 0 93.7%
if 3.9e101 < rand Initial program 99.7%
*-lft-identity99.7%
*-lft-identity99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in rand around inf 95.6%
*-commutative95.6%
sub-neg95.6%
metadata-eval95.6%
associate-*l*95.6%
metadata-eval95.6%
sub-neg95.6%
*-commutative95.6%
sub-neg95.6%
metadata-eval95.6%
Simplified95.6%
associate-*r*95.4%
metadata-eval95.4%
div-inv95.5%
associate-*l/95.8%
Applied egg-rr95.8%
Final simplification93.9%
(FPCore (a rand) :precision binary64 (if (or (<= rand -7.5e+82) (not (<= rand 8.5e+101))) (* 0.3333333333333333 (* rand (sqrt a))) (- a 0.3333333333333333)))
double code(double a, double rand) {
double tmp;
if ((rand <= -7.5e+82) || !(rand <= 8.5e+101)) {
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 <= (-7.5d+82)) .or. (.not. (rand <= 8.5d+101))) 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 <= -7.5e+82) || !(rand <= 8.5e+101)) {
tmp = 0.3333333333333333 * (rand * Math.sqrt(a));
} else {
tmp = a - 0.3333333333333333;
}
return tmp;
}
def code(a, rand): tmp = 0 if (rand <= -7.5e+82) or not (rand <= 8.5e+101): tmp = 0.3333333333333333 * (rand * math.sqrt(a)) else: tmp = a - 0.3333333333333333 return tmp
function code(a, rand) tmp = 0.0 if ((rand <= -7.5e+82) || !(rand <= 8.5e+101)) 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 <= -7.5e+82) || ~((rand <= 8.5e+101))) tmp = 0.3333333333333333 * (rand * sqrt(a)); else tmp = a - 0.3333333333333333; end tmp_2 = tmp; end
code[a_, rand_] := If[Or[LessEqual[rand, -7.5e+82], N[Not[LessEqual[rand, 8.5e+101]], $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 -7.5 \cdot 10^{+82} \lor \neg \left(rand \leq 8.5 \cdot 10^{+101}\right):\\
\;\;\;\;0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)\\
\mathbf{else}:\\
\;\;\;\;a - 0.3333333333333333\\
\end{array}
\end{array}
if rand < -7.4999999999999999e82 or 8.5000000000000001e101 < 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%
Taylor expanded in rand around inf 94.0%
*-commutative94.0%
sub-neg94.0%
metadata-eval94.0%
associate-*l*94.1%
metadata-eval94.1%
sub-neg94.1%
*-commutative94.1%
sub-neg94.1%
metadata-eval94.1%
Simplified94.1%
Taylor expanded in a around inf 92.9%
if -7.4999999999999999e82 < rand < 8.5000000000000001e101Initial program 99.9%
*-lft-identity99.9%
*-lft-identity99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in rand around 0 93.7%
Final simplification93.4%
(FPCore (a rand) :precision binary64 (if (or (<= rand -6.5e+83) (not (<= rand 2.1e+102))) (* rand (sqrt (* a 0.1111111111111111))) (- a 0.3333333333333333)))
double code(double a, double rand) {
double tmp;
if ((rand <= -6.5e+83) || !(rand <= 2.1e+102)) {
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 <= (-6.5d+83)) .or. (.not. (rand <= 2.1d+102))) 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 <= -6.5e+83) || !(rand <= 2.1e+102)) {
tmp = rand * Math.sqrt((a * 0.1111111111111111));
} else {
tmp = a - 0.3333333333333333;
}
return tmp;
}
def code(a, rand): tmp = 0 if (rand <= -6.5e+83) or not (rand <= 2.1e+102): tmp = rand * math.sqrt((a * 0.1111111111111111)) else: tmp = a - 0.3333333333333333 return tmp
function code(a, rand) tmp = 0.0 if ((rand <= -6.5e+83) || !(rand <= 2.1e+102)) 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 <= -6.5e+83) || ~((rand <= 2.1e+102))) tmp = rand * sqrt((a * 0.1111111111111111)); else tmp = a - 0.3333333333333333; end tmp_2 = tmp; end
code[a_, rand_] := If[Or[LessEqual[rand, -6.5e+83], N[Not[LessEqual[rand, 2.1e+102]], $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 -6.5 \cdot 10^{+83} \lor \neg \left(rand \leq 2.1 \cdot 10^{+102}\right):\\
\;\;\;\;rand \cdot \sqrt{a \cdot 0.1111111111111111}\\
\mathbf{else}:\\
\;\;\;\;a - 0.3333333333333333\\
\end{array}
\end{array}
if rand < -6.5000000000000003e83 or 2.10000000000000001e102 < 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%
Taylor expanded in rand around inf 94.0%
*-commutative94.0%
sub-neg94.0%
metadata-eval94.0%
associate-*l*94.1%
metadata-eval94.1%
sub-neg94.1%
*-commutative94.1%
sub-neg94.1%
metadata-eval94.1%
Simplified94.1%
Taylor expanded in a around inf 92.9%
add-sqr-sqrt92.8%
sqrt-unprod92.9%
*-commutative92.9%
*-commutative92.9%
swap-sqr93.0%
add-sqr-sqrt93.1%
metadata-eval93.1%
Applied egg-rr93.1%
if -6.5000000000000003e83 < rand < 2.10000000000000001e102Initial program 99.9%
*-lft-identity99.9%
*-lft-identity99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in rand around 0 93.7%
Final simplification93.5%
(FPCore (a rand)
:precision binary64
(if (<= rand -1.6e+83)
(* rand (/ (sqrt a) 3.0))
(if (<= rand 3.5e+101)
(- a 0.3333333333333333)
(* rand (sqrt (* a 0.1111111111111111))))))
double code(double a, double rand) {
double tmp;
if (rand <= -1.6e+83) {
tmp = rand * (sqrt(a) / 3.0);
} else if (rand <= 3.5e+101) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand * sqrt((a * 0.1111111111111111));
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: tmp
if (rand <= (-1.6d+83)) then
tmp = rand * (sqrt(a) / 3.0d0)
else if (rand <= 3.5d+101) then
tmp = a - 0.3333333333333333d0
else
tmp = rand * sqrt((a * 0.1111111111111111d0))
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if (rand <= -1.6e+83) {
tmp = rand * (Math.sqrt(a) / 3.0);
} else if (rand <= 3.5e+101) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand * Math.sqrt((a * 0.1111111111111111));
}
return tmp;
}
def code(a, rand): tmp = 0 if rand <= -1.6e+83: tmp = rand * (math.sqrt(a) / 3.0) elif rand <= 3.5e+101: tmp = a - 0.3333333333333333 else: tmp = rand * math.sqrt((a * 0.1111111111111111)) return tmp
function code(a, rand) tmp = 0.0 if (rand <= -1.6e+83) tmp = Float64(rand * Float64(sqrt(a) / 3.0)); elseif (rand <= 3.5e+101) tmp = Float64(a - 0.3333333333333333); else tmp = Float64(rand * sqrt(Float64(a * 0.1111111111111111))); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if (rand <= -1.6e+83) tmp = rand * (sqrt(a) / 3.0); elseif (rand <= 3.5e+101) tmp = a - 0.3333333333333333; else tmp = rand * sqrt((a * 0.1111111111111111)); end tmp_2 = tmp; end
code[a_, rand_] := If[LessEqual[rand, -1.6e+83], N[(rand * N[(N[Sqrt[a], $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 3.5e+101], N[(a - 0.3333333333333333), $MachinePrecision], N[(rand * N[Sqrt[N[(a * 0.1111111111111111), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -1.6 \cdot 10^{+83}:\\
\;\;\;\;rand \cdot \frac{\sqrt{a}}{3}\\
\mathbf{elif}\;rand \leq 3.5 \cdot 10^{+101}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;rand \cdot \sqrt{a \cdot 0.1111111111111111}\\
\end{array}
\end{array}
if rand < -1.5999999999999999e83Initial program 99.4%
*-lft-identity99.4%
*-lft-identity99.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 92.8%
*-commutative92.8%
sub-neg92.8%
metadata-eval92.8%
associate-*l*93.0%
metadata-eval93.0%
sub-neg93.0%
*-commutative93.0%
sub-neg93.0%
metadata-eval93.0%
Simplified93.0%
Taylor expanded in a around inf 91.9%
*-commutative91.9%
metadata-eval91.9%
div-inv92.2%
Applied egg-rr92.2%
if -1.5999999999999999e83 < rand < 3.50000000000000023e101Initial program 99.9%
*-lft-identity99.9%
*-lft-identity99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in rand around 0 93.7%
if 3.50000000000000023e101 < rand Initial program 99.7%
*-lft-identity99.7%
*-lft-identity99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in rand around inf 95.6%
*-commutative95.6%
sub-neg95.6%
metadata-eval95.6%
associate-*l*95.6%
metadata-eval95.6%
sub-neg95.6%
*-commutative95.6%
sub-neg95.6%
metadata-eval95.6%
Simplified95.6%
Taylor expanded in a around inf 94.3%
add-sqr-sqrt94.1%
sqrt-unprod94.3%
*-commutative94.3%
*-commutative94.3%
swap-sqr94.3%
add-sqr-sqrt94.4%
metadata-eval94.4%
Applied egg-rr94.4%
Final simplification93.5%
(FPCore (a rand)
:precision binary64
(if (<= rand -3.3e+83)
(* (* 0.3333333333333333 rand) (sqrt a))
(if (<= rand 1.66e+103)
(- a 0.3333333333333333)
(* rand (sqrt (* a 0.1111111111111111))))))
double code(double a, double rand) {
double tmp;
if (rand <= -3.3e+83) {
tmp = (0.3333333333333333 * rand) * sqrt(a);
} else if (rand <= 1.66e+103) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand * sqrt((a * 0.1111111111111111));
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: tmp
if (rand <= (-3.3d+83)) then
tmp = (0.3333333333333333d0 * rand) * sqrt(a)
else if (rand <= 1.66d+103) then
tmp = a - 0.3333333333333333d0
else
tmp = rand * sqrt((a * 0.1111111111111111d0))
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if (rand <= -3.3e+83) {
tmp = (0.3333333333333333 * rand) * Math.sqrt(a);
} else if (rand <= 1.66e+103) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand * Math.sqrt((a * 0.1111111111111111));
}
return tmp;
}
def code(a, rand): tmp = 0 if rand <= -3.3e+83: tmp = (0.3333333333333333 * rand) * math.sqrt(a) elif rand <= 1.66e+103: tmp = a - 0.3333333333333333 else: tmp = rand * math.sqrt((a * 0.1111111111111111)) return tmp
function code(a, rand) tmp = 0.0 if (rand <= -3.3e+83) tmp = Float64(Float64(0.3333333333333333 * rand) * sqrt(a)); elseif (rand <= 1.66e+103) tmp = Float64(a - 0.3333333333333333); else tmp = Float64(rand * sqrt(Float64(a * 0.1111111111111111))); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if (rand <= -3.3e+83) tmp = (0.3333333333333333 * rand) * sqrt(a); elseif (rand <= 1.66e+103) tmp = a - 0.3333333333333333; else tmp = rand * sqrt((a * 0.1111111111111111)); end tmp_2 = tmp; end
code[a_, rand_] := If[LessEqual[rand, -3.3e+83], N[(N[(0.3333333333333333 * rand), $MachinePrecision] * N[Sqrt[a], $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 1.66e+103], N[(a - 0.3333333333333333), $MachinePrecision], N[(rand * N[Sqrt[N[(a * 0.1111111111111111), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -3.3 \cdot 10^{+83}:\\
\;\;\;\;\left(0.3333333333333333 \cdot rand\right) \cdot \sqrt{a}\\
\mathbf{elif}\;rand \leq 1.66 \cdot 10^{+103}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;rand \cdot \sqrt{a \cdot 0.1111111111111111}\\
\end{array}
\end{array}
if rand < -3.29999999999999985e83Initial program 99.4%
*-lft-identity99.4%
*-lft-identity99.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 92.8%
*-commutative92.8%
sub-neg92.8%
metadata-eval92.8%
associate-*l*93.0%
metadata-eval93.0%
sub-neg93.0%
*-commutative93.0%
sub-neg93.0%
metadata-eval93.0%
Simplified93.0%
Taylor expanded in a around inf 91.8%
Taylor expanded in a around -inf 0.0%
associate-*r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt91.9%
associate-*r*91.9%
*-commutative91.9%
associate-*l*91.9%
metadata-eval91.9%
associate-*l*92.2%
Simplified92.2%
if -3.29999999999999985e83 < rand < 1.6600000000000001e103Initial program 99.9%
*-lft-identity99.9%
*-lft-identity99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in rand around 0 93.7%
if 1.6600000000000001e103 < rand Initial program 99.7%
*-lft-identity99.7%
*-lft-identity99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in rand around inf 95.6%
*-commutative95.6%
sub-neg95.6%
metadata-eval95.6%
associate-*l*95.6%
metadata-eval95.6%
sub-neg95.6%
*-commutative95.6%
sub-neg95.6%
metadata-eval95.6%
Simplified95.6%
Taylor expanded in a around inf 94.3%
add-sqr-sqrt94.1%
sqrt-unprod94.3%
*-commutative94.3%
*-commutative94.3%
swap-sqr94.3%
add-sqr-sqrt94.4%
metadata-eval94.4%
Applied egg-rr94.4%
Final simplification93.5%
(FPCore (a rand) :precision binary64 (if (<= rand -2e+83) (* (* 0.3333333333333333 rand) (sqrt a)) (if (<= rand 5.3e+101) (- a 0.3333333333333333) (/ (* rand (sqrt a)) 3.0))))
double code(double a, double rand) {
double tmp;
if (rand <= -2e+83) {
tmp = (0.3333333333333333 * rand) * sqrt(a);
} else if (rand <= 5.3e+101) {
tmp = a - 0.3333333333333333;
} else {
tmp = (rand * sqrt(a)) / 3.0;
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: tmp
if (rand <= (-2d+83)) then
tmp = (0.3333333333333333d0 * rand) * sqrt(a)
else if (rand <= 5.3d+101) then
tmp = a - 0.3333333333333333d0
else
tmp = (rand * sqrt(a)) / 3.0d0
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if (rand <= -2e+83) {
tmp = (0.3333333333333333 * rand) * Math.sqrt(a);
} else if (rand <= 5.3e+101) {
tmp = a - 0.3333333333333333;
} else {
tmp = (rand * Math.sqrt(a)) / 3.0;
}
return tmp;
}
def code(a, rand): tmp = 0 if rand <= -2e+83: tmp = (0.3333333333333333 * rand) * math.sqrt(a) elif rand <= 5.3e+101: tmp = a - 0.3333333333333333 else: tmp = (rand * math.sqrt(a)) / 3.0 return tmp
function code(a, rand) tmp = 0.0 if (rand <= -2e+83) tmp = Float64(Float64(0.3333333333333333 * rand) * sqrt(a)); elseif (rand <= 5.3e+101) tmp = Float64(a - 0.3333333333333333); else tmp = Float64(Float64(rand * sqrt(a)) / 3.0); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if (rand <= -2e+83) tmp = (0.3333333333333333 * rand) * sqrt(a); elseif (rand <= 5.3e+101) tmp = a - 0.3333333333333333; else tmp = (rand * sqrt(a)) / 3.0; end tmp_2 = tmp; end
code[a_, rand_] := If[LessEqual[rand, -2e+83], N[(N[(0.3333333333333333 * rand), $MachinePrecision] * N[Sqrt[a], $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 5.3e+101], N[(a - 0.3333333333333333), $MachinePrecision], N[(N[(rand * N[Sqrt[a], $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -2 \cdot 10^{+83}:\\
\;\;\;\;\left(0.3333333333333333 \cdot rand\right) \cdot \sqrt{a}\\
\mathbf{elif}\;rand \leq 5.3 \cdot 10^{+101}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{rand \cdot \sqrt{a}}{3}\\
\end{array}
\end{array}
if rand < -2.00000000000000006e83Initial program 99.4%
*-lft-identity99.4%
*-lft-identity99.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 92.8%
*-commutative92.8%
sub-neg92.8%
metadata-eval92.8%
associate-*l*93.0%
metadata-eval93.0%
sub-neg93.0%
*-commutative93.0%
sub-neg93.0%
metadata-eval93.0%
Simplified93.0%
Taylor expanded in a around inf 91.8%
Taylor expanded in a around -inf 0.0%
associate-*r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt91.9%
associate-*r*91.9%
*-commutative91.9%
associate-*l*91.9%
metadata-eval91.9%
associate-*l*92.2%
Simplified92.2%
if -2.00000000000000006e83 < rand < 5.30000000000000006e101Initial program 99.9%
*-lft-identity99.9%
*-lft-identity99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in rand around 0 93.7%
if 5.30000000000000006e101 < rand Initial program 99.7%
*-lft-identity99.7%
*-lft-identity99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in rand around inf 95.6%
*-commutative95.6%
sub-neg95.6%
metadata-eval95.6%
associate-*l*95.6%
metadata-eval95.6%
sub-neg95.6%
*-commutative95.6%
sub-neg95.6%
metadata-eval95.6%
Simplified95.6%
Taylor expanded in a around inf 94.3%
Taylor expanded in a around -inf 0.0%
associate-*r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt94.3%
associate-*r*94.3%
*-commutative94.3%
associate-*l*94.3%
metadata-eval94.3%
associate-*l*94.1%
Simplified94.1%
associate-*r*94.3%
metadata-eval94.3%
div-inv94.3%
associate-*l/94.4%
Applied egg-rr94.4%
Final simplification93.5%
(FPCore (a rand) :precision binary64 (* (+ a -0.3333333333333333) (+ 1.0 (/ rand (sqrt (+ (* a 9.0) -3.0))))))
double code(double a, double rand) {
return (a + -0.3333333333333333) * (1.0 + (rand / sqrt(((a * 9.0) + -3.0))));
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = (a + (-0.3333333333333333d0)) * (1.0d0 + (rand / sqrt(((a * 9.0d0) + (-3.0d0)))))
end function
public static double code(double a, double rand) {
return (a + -0.3333333333333333) * (1.0 + (rand / Math.sqrt(((a * 9.0) + -3.0))));
}
def code(a, rand): return (a + -0.3333333333333333) * (1.0 + (rand / math.sqrt(((a * 9.0) + -3.0))))
function code(a, rand) return Float64(Float64(a + -0.3333333333333333) * Float64(1.0 + Float64(rand / sqrt(Float64(Float64(a * 9.0) + -3.0))))) end
function tmp = code(a, rand) tmp = (a + -0.3333333333333333) * (1.0 + (rand / sqrt(((a * 9.0) + -3.0)))); end
code[a_, rand_] := N[(N[(a + -0.3333333333333333), $MachinePrecision] * N[(1.0 + N[(rand / N[Sqrt[N[(N[(a * 9.0), $MachinePrecision] + -3.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a + -0.3333333333333333\right) \cdot \left(1 + \frac{rand}{\sqrt{a \cdot 9 + -3}}\right)
\end{array}
Initial program 99.8%
*-lft-identity99.8%
*-lft-identity99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
associate-*l/99.8%
*-lft-identity99.8%
sub-neg99.8%
distribute-lft-in99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(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%
*-lft-identity99.8%
*-lft-identity99.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.5%
Final simplification99.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.8%
*-lft-identity99.8%
*-lft-identity99.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.5%
Taylor expanded in a around inf 98.8%
Final simplification98.8%
(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(Float64(0.3333333333333333 * 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[(N[(0.3333333333333333 * rand), $MachinePrecision] * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision]
\begin{array}{l}
\\
\left(a + \left(0.3333333333333333 \cdot rand\right) \cdot \sqrt{a}\right) - 0.3333333333333333
\end{array}
Initial program 99.8%
*-lft-identity99.8%
*-lft-identity99.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.5%
Taylor expanded in a around inf 98.8%
Taylor expanded in a around -inf 0.0%
associate-*r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt32.8%
associate-*r*32.8%
*-commutative32.8%
associate-*l*32.8%
metadata-eval32.8%
associate-*l*32.8%
Simplified99.1%
Final simplification99.1%
(FPCore (a rand) :precision binary64 (- (+ a (/ (sqrt a) (/ 3.0 rand))) 0.3333333333333333))
double code(double a, double rand) {
return (a + (sqrt(a) / (3.0 / rand))) - 0.3333333333333333;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = (a + (sqrt(a) / (3.0d0 / rand))) - 0.3333333333333333d0
end function
public static double code(double a, double rand) {
return (a + (Math.sqrt(a) / (3.0 / rand))) - 0.3333333333333333;
}
def code(a, rand): return (a + (math.sqrt(a) / (3.0 / rand))) - 0.3333333333333333
function code(a, rand) return Float64(Float64(a + Float64(sqrt(a) / Float64(3.0 / rand))) - 0.3333333333333333) end
function tmp = code(a, rand) tmp = (a + (sqrt(a) / (3.0 / rand))) - 0.3333333333333333; end
code[a_, rand_] := N[(N[(a + N[(N[Sqrt[a], $MachinePrecision] / N[(3.0 / rand), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision]
\begin{array}{l}
\\
\left(a + \frac{\sqrt{a}}{\frac{3}{rand}}\right) - 0.3333333333333333
\end{array}
Initial program 99.8%
*-lft-identity99.8%
*-lft-identity99.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.5%
Taylor expanded in a around inf 98.8%
Taylor expanded in a around -inf 0.0%
associate-*r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt32.8%
associate-*r*32.8%
*-commutative32.8%
associate-*l*32.8%
metadata-eval32.8%
associate-*l*32.8%
Simplified99.1%
associate-*r*99.1%
metadata-eval99.1%
div-inv99.2%
associate-/r/99.2%
Applied egg-rr99.2%
Final simplification99.2%
(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%
*-lft-identity99.8%
*-lft-identity99.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 67.4%
Final simplification67.4%
herbie shell --seed 2024059
(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))))