
(FPCore (a rand) :precision binary64 (let* ((t_0 (- a (/ 1.0 3.0)))) (* t_0 (+ 1.0 (* (/ 1.0 (sqrt (* 9.0 t_0))) rand)))))
double code(double a, double rand) {
double t_0 = a - (1.0 / 3.0);
return t_0 * (1.0 + ((1.0 / sqrt((9.0 * t_0))) * rand));
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: t_0
t_0 = a - (1.0d0 / 3.0d0)
code = t_0 * (1.0d0 + ((1.0d0 / sqrt((9.0d0 * t_0))) * rand))
end function
public static double code(double a, double rand) {
double t_0 = a - (1.0 / 3.0);
return t_0 * (1.0 + ((1.0 / Math.sqrt((9.0 * t_0))) * rand));
}
def code(a, rand): t_0 = a - (1.0 / 3.0) return t_0 * (1.0 + ((1.0 / math.sqrt((9.0 * t_0))) * rand))
function code(a, rand) t_0 = Float64(a - Float64(1.0 / 3.0)) return Float64(t_0 * Float64(1.0 + Float64(Float64(1.0 / sqrt(Float64(9.0 * t_0))) * rand))) end
function tmp = code(a, rand) t_0 = a - (1.0 / 3.0); tmp = t_0 * (1.0 + ((1.0 / sqrt((9.0 * t_0))) * rand)); end
code[a_, rand_] := Block[{t$95$0 = N[(a - N[(1.0 / 3.0), $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * N[(1.0 + N[(N[(1.0 / N[Sqrt[N[(9.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * rand), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a - \frac{1}{3}\\
t\_0 \cdot \left(1 + \frac{1}{\sqrt{9 \cdot t\_0}} \cdot rand\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a rand) :precision binary64 (let* ((t_0 (- a (/ 1.0 3.0)))) (* t_0 (+ 1.0 (* (/ 1.0 (sqrt (* 9.0 t_0))) rand)))))
double code(double a, double rand) {
double t_0 = a - (1.0 / 3.0);
return t_0 * (1.0 + ((1.0 / sqrt((9.0 * t_0))) * rand));
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: t_0
t_0 = a - (1.0d0 / 3.0d0)
code = t_0 * (1.0d0 + ((1.0d0 / sqrt((9.0d0 * t_0))) * rand))
end function
public static double code(double a, double rand) {
double t_0 = a - (1.0 / 3.0);
return t_0 * (1.0 + ((1.0 / Math.sqrt((9.0 * t_0))) * rand));
}
def code(a, rand): t_0 = a - (1.0 / 3.0) return t_0 * (1.0 + ((1.0 / math.sqrt((9.0 * t_0))) * rand))
function code(a, rand) t_0 = Float64(a - Float64(1.0 / 3.0)) return Float64(t_0 * Float64(1.0 + Float64(Float64(1.0 / sqrt(Float64(9.0 * t_0))) * rand))) end
function tmp = code(a, rand) t_0 = a - (1.0 / 3.0); tmp = t_0 * (1.0 + ((1.0 / sqrt((9.0 * t_0))) * rand)); end
code[a_, rand_] := Block[{t$95$0 = N[(a - N[(1.0 / 3.0), $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * N[(1.0 + N[(N[(1.0 / N[Sqrt[N[(9.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * rand), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a - \frac{1}{3}\\
t\_0 \cdot \left(1 + \frac{1}{\sqrt{9 \cdot t\_0}} \cdot rand\right)
\end{array}
\end{array}
(FPCore (a rand)
:precision binary64
(+
a
(-
(*
rand
(/ (+ a -0.3333333333333333) (* (sqrt (+ a -0.3333333333333333)) 3.0)))
0.3333333333333333)))
double code(double a, double rand) {
return a + ((rand * ((a + -0.3333333333333333) / (sqrt((a + -0.3333333333333333)) * 3.0))) - 0.3333333333333333);
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = a + ((rand * ((a + (-0.3333333333333333d0)) / (sqrt((a + (-0.3333333333333333d0))) * 3.0d0))) - 0.3333333333333333d0)
end function
public static double code(double a, double rand) {
return a + ((rand * ((a + -0.3333333333333333) / (Math.sqrt((a + -0.3333333333333333)) * 3.0))) - 0.3333333333333333);
}
def code(a, rand): return a + ((rand * ((a + -0.3333333333333333) / (math.sqrt((a + -0.3333333333333333)) * 3.0))) - 0.3333333333333333)
function code(a, rand) return Float64(a + Float64(Float64(rand * Float64(Float64(a + -0.3333333333333333) / Float64(sqrt(Float64(a + -0.3333333333333333)) * 3.0))) - 0.3333333333333333)) end
function tmp = code(a, rand) tmp = a + ((rand * ((a + -0.3333333333333333) / (sqrt((a + -0.3333333333333333)) * 3.0))) - 0.3333333333333333); end
code[a_, rand_] := N[(a + N[(N[(rand * N[(N[(a + -0.3333333333333333), $MachinePrecision] / N[(N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a + \left(rand \cdot \frac{a + -0.3333333333333333}{\sqrt{a + -0.3333333333333333} \cdot 3} - 0.3333333333333333\right)
\end{array}
Initial program 99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
frac-2neg99.4%
metadata-eval99.4%
div-inv99.4%
sqrt-prod99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
Applied egg-rr99.8%
associate-*r/99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
metadata-eval99.8%
sub-neg99.8%
distribute-rgt-in99.8%
*-un-lft-identity99.8%
metadata-eval99.8%
sqrt-div99.8%
*-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
associate-*r*99.8%
associate-+l-99.8%
+-commutative99.8%
metadata-eval99.8%
sub-neg99.8%
*-commutative99.8%
sqrt-div99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (a rand) :precision binary64 (if (or (<= rand -1.15e+64) (not (<= rand 3.65e+84))) (* 0.3333333333333333 (* rand (sqrt (- a 0.3333333333333333)))) (- a 0.3333333333333333)))
double code(double a, double rand) {
double tmp;
if ((rand <= -1.15e+64) || !(rand <= 3.65e+84)) {
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 <= (-1.15d+64)) .or. (.not. (rand <= 3.65d+84))) 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 <= -1.15e+64) || !(rand <= 3.65e+84)) {
tmp = 0.3333333333333333 * (rand * Math.sqrt((a - 0.3333333333333333)));
} else {
tmp = a - 0.3333333333333333;
}
return tmp;
}
def code(a, rand): tmp = 0 if (rand <= -1.15e+64) or not (rand <= 3.65e+84): 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 <= -1.15e+64) || !(rand <= 3.65e+84)) 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 <= -1.15e+64) || ~((rand <= 3.65e+84))) 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, -1.15e+64], N[Not[LessEqual[rand, 3.65e+84]], $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 -1.15 \cdot 10^{+64} \lor \neg \left(rand \leq 3.65 \cdot 10^{+84}\right):\\
\;\;\;\;0.3333333333333333 \cdot \left(rand \cdot \sqrt{a - 0.3333333333333333}\right)\\
\mathbf{else}:\\
\;\;\;\;a - 0.3333333333333333\\
\end{array}
\end{array}
if rand < -1.15e64 or 3.65e84 < rand Initial program 98.5%
sub-neg98.5%
metadata-eval98.5%
metadata-eval98.5%
*-commutative98.5%
sub-neg98.5%
metadata-eval98.5%
metadata-eval98.5%
Simplified98.5%
Taylor expanded in rand around inf 92.1%
if -1.15e64 < rand < 3.65e84Initial program 99.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.1%
(FPCore (a rand) :precision binary64 (if (or (<= rand -1.48e+97) (not (<= rand 4.55e+86))) (* rand (sqrt (* (+ a -0.3333333333333333) 0.1111111111111111))) (- a 0.3333333333333333)))
double code(double a, double rand) {
double tmp;
if ((rand <= -1.48e+97) || !(rand <= 4.55e+86)) {
tmp = rand * sqrt(((a + -0.3333333333333333) * 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.48d+97)) .or. (.not. (rand <= 4.55d+86))) then
tmp = rand * sqrt(((a + (-0.3333333333333333d0)) * 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.48e+97) || !(rand <= 4.55e+86)) {
tmp = rand * Math.sqrt(((a + -0.3333333333333333) * 0.1111111111111111));
} else {
tmp = a - 0.3333333333333333;
}
return tmp;
}
def code(a, rand): tmp = 0 if (rand <= -1.48e+97) or not (rand <= 4.55e+86): tmp = rand * math.sqrt(((a + -0.3333333333333333) * 0.1111111111111111)) else: tmp = a - 0.3333333333333333 return tmp
function code(a, rand) tmp = 0.0 if ((rand <= -1.48e+97) || !(rand <= 4.55e+86)) tmp = Float64(rand * sqrt(Float64(Float64(a + -0.3333333333333333) * 0.1111111111111111))); else tmp = Float64(a - 0.3333333333333333); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if ((rand <= -1.48e+97) || ~((rand <= 4.55e+86))) tmp = rand * sqrt(((a + -0.3333333333333333) * 0.1111111111111111)); else tmp = a - 0.3333333333333333; end tmp_2 = tmp; end
code[a_, rand_] := If[Or[LessEqual[rand, -1.48e+97], N[Not[LessEqual[rand, 4.55e+86]], $MachinePrecision]], N[(rand * N[Sqrt[N[(N[(a + -0.3333333333333333), $MachinePrecision] * 0.1111111111111111), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(a - 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -1.48 \cdot 10^{+97} \lor \neg \left(rand \leq 4.55 \cdot 10^{+86}\right):\\
\;\;\;\;rand \cdot \sqrt{\left(a + -0.3333333333333333\right) \cdot 0.1111111111111111}\\
\mathbf{else}:\\
\;\;\;\;a - 0.3333333333333333\\
\end{array}
\end{array}
if rand < -1.47999999999999996e97 or 4.5499999999999999e86 < rand Initial program 98.5%
sub-neg98.5%
metadata-eval98.5%
metadata-eval98.5%
associate-*l/98.5%
*-lft-identity98.5%
sub-neg98.5%
distribute-lft-in98.5%
metadata-eval98.5%
metadata-eval98.5%
metadata-eval98.5%
Simplified98.5%
Taylor expanded in rand around inf 68.9%
sub-neg68.9%
metadata-eval68.9%
associate-*l*93.7%
*-commutative93.7%
sub-neg93.7%
metadata-eval93.7%
metadata-eval93.7%
distribute-lft-in93.7%
associate-/r*94.7%
metadata-eval94.7%
+-commutative94.7%
+-commutative94.7%
Simplified94.7%
+-commutative94.7%
metadata-eval94.7%
sub-neg94.7%
*-commutative94.7%
sqrt-div94.7%
metadata-eval94.7%
clear-num94.7%
un-div-inv94.7%
sub-neg94.7%
metadata-eval94.7%
+-commutative94.7%
div-inv94.9%
metadata-eval94.9%
Applied egg-rr94.9%
*-un-lft-identity94.9%
*-commutative94.9%
times-frac94.7%
metadata-eval94.7%
pow194.7%
pow1/294.7%
pow-div94.6%
metadata-eval94.6%
+-commutative94.6%
pow1/294.6%
add-sqr-sqrt94.6%
sqrt-unprod94.6%
*-commutative94.6%
+-commutative94.6%
*-commutative94.6%
+-commutative94.6%
swap-sqr94.7%
add-sqr-sqrt94.9%
metadata-eval94.9%
Applied egg-rr94.9%
if -1.47999999999999996e97 < rand < 4.5499999999999999e86Initial program 99.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 92.6%
Final simplification93.5%
(FPCore (a rand)
:precision binary64
(if (<= rand -7.5e+63)
(/ rand (sqrt (/ 9.0 (+ a -0.3333333333333333))))
(if (<= rand 8.5e+85)
(- a 0.3333333333333333)
(* rand (sqrt (* (+ a -0.3333333333333333) 0.1111111111111111))))))
double code(double a, double rand) {
double tmp;
if (rand <= -7.5e+63) {
tmp = rand / sqrt((9.0 / (a + -0.3333333333333333)));
} else if (rand <= 8.5e+85) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand * sqrt(((a + -0.3333333333333333) * 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 <= (-7.5d+63)) then
tmp = rand / sqrt((9.0d0 / (a + (-0.3333333333333333d0))))
else if (rand <= 8.5d+85) then
tmp = a - 0.3333333333333333d0
else
tmp = rand * sqrt(((a + (-0.3333333333333333d0)) * 0.1111111111111111d0))
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if (rand <= -7.5e+63) {
tmp = rand / Math.sqrt((9.0 / (a + -0.3333333333333333)));
} else if (rand <= 8.5e+85) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand * Math.sqrt(((a + -0.3333333333333333) * 0.1111111111111111));
}
return tmp;
}
def code(a, rand): tmp = 0 if rand <= -7.5e+63: tmp = rand / math.sqrt((9.0 / (a + -0.3333333333333333))) elif rand <= 8.5e+85: tmp = a - 0.3333333333333333 else: tmp = rand * math.sqrt(((a + -0.3333333333333333) * 0.1111111111111111)) return tmp
function code(a, rand) tmp = 0.0 if (rand <= -7.5e+63) tmp = Float64(rand / sqrt(Float64(9.0 / Float64(a + -0.3333333333333333)))); elseif (rand <= 8.5e+85) tmp = Float64(a - 0.3333333333333333); else tmp = Float64(rand * sqrt(Float64(Float64(a + -0.3333333333333333) * 0.1111111111111111))); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if (rand <= -7.5e+63) tmp = rand / sqrt((9.0 / (a + -0.3333333333333333))); elseif (rand <= 8.5e+85) tmp = a - 0.3333333333333333; else tmp = rand * sqrt(((a + -0.3333333333333333) * 0.1111111111111111)); end tmp_2 = tmp; end
code[a_, rand_] := If[LessEqual[rand, -7.5e+63], N[(rand / N[Sqrt[N[(9.0 / N[(a + -0.3333333333333333), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 8.5e+85], N[(a - 0.3333333333333333), $MachinePrecision], N[(rand * N[Sqrt[N[(N[(a + -0.3333333333333333), $MachinePrecision] * 0.1111111111111111), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -7.5 \cdot 10^{+63}:\\
\;\;\;\;\frac{rand}{\sqrt{\frac{9}{a + -0.3333333333333333}}}\\
\mathbf{elif}\;rand \leq 8.5 \cdot 10^{+85}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;rand \cdot \sqrt{\left(a + -0.3333333333333333\right) \cdot 0.1111111111111111}\\
\end{array}
\end{array}
if rand < -7.5000000000000005e63Initial program 97.1%
sub-neg97.1%
metadata-eval97.1%
metadata-eval97.1%
associate-*l/97.2%
*-lft-identity97.2%
sub-neg97.2%
distribute-lft-in97.2%
metadata-eval97.2%
metadata-eval97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in rand around inf 76.0%
sub-neg76.0%
metadata-eval76.0%
associate-*l*90.2%
*-commutative90.2%
sub-neg90.2%
metadata-eval90.2%
metadata-eval90.2%
distribute-lft-in90.2%
associate-/r*92.6%
metadata-eval92.6%
+-commutative92.6%
+-commutative92.6%
Simplified92.6%
+-commutative92.6%
metadata-eval92.6%
sub-neg92.6%
*-commutative92.6%
sqrt-div92.6%
metadata-eval92.6%
clear-num92.5%
un-div-inv92.7%
sub-neg92.7%
metadata-eval92.7%
+-commutative92.7%
div-inv92.8%
metadata-eval92.8%
Applied egg-rr92.8%
clear-num92.7%
un-div-inv92.7%
*-commutative92.7%
associate-/l*92.7%
pow192.7%
pow1/292.7%
pow-div92.9%
metadata-eval92.9%
pow1/292.9%
Applied egg-rr92.9%
add-sqr-sqrt92.5%
sqrt-unprod92.9%
frac-times92.8%
metadata-eval92.8%
add-sqr-sqrt92.8%
Applied egg-rr92.8%
if -7.5000000000000005e63 < rand < 8.4999999999999994e85Initial program 99.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 8.4999999999999994e85 < rand Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*l/99.5%
*-lft-identity99.5%
sub-neg99.5%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in rand around inf 62.4%
sub-neg62.4%
metadata-eval62.4%
associate-*l*93.2%
*-commutative93.2%
sub-neg93.2%
metadata-eval93.2%
metadata-eval93.2%
distribute-lft-in93.2%
associate-/r*93.2%
metadata-eval93.2%
+-commutative93.2%
+-commutative93.2%
Simplified93.2%
+-commutative93.2%
metadata-eval93.2%
sub-neg93.2%
*-commutative93.2%
sqrt-div93.1%
metadata-eval93.1%
clear-num93.2%
un-div-inv93.2%
sub-neg93.2%
metadata-eval93.2%
+-commutative93.2%
div-inv93.4%
metadata-eval93.4%
Applied egg-rr93.4%
*-un-lft-identity93.4%
*-commutative93.4%
times-frac93.2%
metadata-eval93.2%
pow193.2%
pow1/293.2%
pow-div93.1%
metadata-eval93.1%
+-commutative93.1%
pow1/293.1%
add-sqr-sqrt93.0%
sqrt-unprod93.1%
*-commutative93.1%
+-commutative93.1%
*-commutative93.1%
+-commutative93.1%
swap-sqr93.2%
add-sqr-sqrt93.3%
metadata-eval93.3%
Applied egg-rr93.3%
Final simplification93.5%
(FPCore (a rand)
:precision binary64
(if (<= rand -1.3e+64)
(/ rand (/ 3.0 (sqrt (+ a -0.3333333333333333))))
(if (<= rand 5.8e+86)
(- a 0.3333333333333333)
(* rand (sqrt (* (+ a -0.3333333333333333) 0.1111111111111111))))))
double code(double a, double rand) {
double tmp;
if (rand <= -1.3e+64) {
tmp = rand / (3.0 / sqrt((a + -0.3333333333333333)));
} else if (rand <= 5.8e+86) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand * sqrt(((a + -0.3333333333333333) * 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.3d+64)) then
tmp = rand / (3.0d0 / sqrt((a + (-0.3333333333333333d0))))
else if (rand <= 5.8d+86) then
tmp = a - 0.3333333333333333d0
else
tmp = rand * sqrt(((a + (-0.3333333333333333d0)) * 0.1111111111111111d0))
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if (rand <= -1.3e+64) {
tmp = rand / (3.0 / Math.sqrt((a + -0.3333333333333333)));
} else if (rand <= 5.8e+86) {
tmp = a - 0.3333333333333333;
} else {
tmp = rand * Math.sqrt(((a + -0.3333333333333333) * 0.1111111111111111));
}
return tmp;
}
def code(a, rand): tmp = 0 if rand <= -1.3e+64: tmp = rand / (3.0 / math.sqrt((a + -0.3333333333333333))) elif rand <= 5.8e+86: tmp = a - 0.3333333333333333 else: tmp = rand * math.sqrt(((a + -0.3333333333333333) * 0.1111111111111111)) return tmp
function code(a, rand) tmp = 0.0 if (rand <= -1.3e+64) tmp = Float64(rand / Float64(3.0 / sqrt(Float64(a + -0.3333333333333333)))); elseif (rand <= 5.8e+86) tmp = Float64(a - 0.3333333333333333); else tmp = Float64(rand * sqrt(Float64(Float64(a + -0.3333333333333333) * 0.1111111111111111))); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if (rand <= -1.3e+64) tmp = rand / (3.0 / sqrt((a + -0.3333333333333333))); elseif (rand <= 5.8e+86) tmp = a - 0.3333333333333333; else tmp = rand * sqrt(((a + -0.3333333333333333) * 0.1111111111111111)); end tmp_2 = tmp; end
code[a_, rand_] := If[LessEqual[rand, -1.3e+64], N[(rand / N[(3.0 / N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 5.8e+86], N[(a - 0.3333333333333333), $MachinePrecision], N[(rand * N[Sqrt[N[(N[(a + -0.3333333333333333), $MachinePrecision] * 0.1111111111111111), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -1.3 \cdot 10^{+64}:\\
\;\;\;\;\frac{rand}{\frac{3}{\sqrt{a + -0.3333333333333333}}}\\
\mathbf{elif}\;rand \leq 5.8 \cdot 10^{+86}:\\
\;\;\;\;a - 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;rand \cdot \sqrt{\left(a + -0.3333333333333333\right) \cdot 0.1111111111111111}\\
\end{array}
\end{array}
if rand < -1.29999999999999998e64Initial program 97.1%
sub-neg97.1%
metadata-eval97.1%
metadata-eval97.1%
associate-*l/97.2%
*-lft-identity97.2%
sub-neg97.2%
distribute-lft-in97.2%
metadata-eval97.2%
metadata-eval97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in rand around inf 76.0%
sub-neg76.0%
metadata-eval76.0%
associate-*l*90.2%
*-commutative90.2%
sub-neg90.2%
metadata-eval90.2%
metadata-eval90.2%
distribute-lft-in90.2%
associate-/r*92.6%
metadata-eval92.6%
+-commutative92.6%
+-commutative92.6%
Simplified92.6%
+-commutative92.6%
metadata-eval92.6%
sub-neg92.6%
*-commutative92.6%
sqrt-div92.6%
metadata-eval92.6%
clear-num92.5%
un-div-inv92.7%
sub-neg92.7%
metadata-eval92.7%
+-commutative92.7%
div-inv92.8%
metadata-eval92.8%
Applied egg-rr92.8%
clear-num92.7%
un-div-inv92.7%
*-commutative92.7%
associate-/l*92.7%
pow192.7%
pow1/292.7%
pow-div92.9%
metadata-eval92.9%
pow1/292.9%
Applied egg-rr92.9%
if -1.29999999999999998e64 < rand < 5.79999999999999981e86Initial program 99.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.79999999999999981e86 < rand Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*l/99.5%
*-lft-identity99.5%
sub-neg99.5%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in rand around inf 62.4%
sub-neg62.4%
metadata-eval62.4%
associate-*l*93.2%
*-commutative93.2%
sub-neg93.2%
metadata-eval93.2%
metadata-eval93.2%
distribute-lft-in93.2%
associate-/r*93.2%
metadata-eval93.2%
+-commutative93.2%
+-commutative93.2%
Simplified93.2%
+-commutative93.2%
metadata-eval93.2%
sub-neg93.2%
*-commutative93.2%
sqrt-div93.1%
metadata-eval93.1%
clear-num93.2%
un-div-inv93.2%
sub-neg93.2%
metadata-eval93.2%
+-commutative93.2%
div-inv93.4%
metadata-eval93.4%
Applied egg-rr93.4%
*-un-lft-identity93.4%
*-commutative93.4%
times-frac93.2%
metadata-eval93.2%
pow193.2%
pow1/293.2%
pow-div93.1%
metadata-eval93.1%
+-commutative93.1%
pow1/293.1%
add-sqr-sqrt93.0%
sqrt-unprod93.1%
*-commutative93.1%
+-commutative93.1%
*-commutative93.1%
+-commutative93.1%
swap-sqr93.2%
add-sqr-sqrt93.3%
metadata-eval93.3%
Applied egg-rr93.3%
Final simplification93.5%
(FPCore (a rand) :precision binary64 (if (or (<= rand -7e+96) (not (<= rand 1.66e+84))) (* rand (sqrt (* a 0.1111111111111111))) (- a 0.3333333333333333)))
double code(double a, double rand) {
double tmp;
if ((rand <= -7e+96) || !(rand <= 1.66e+84)) {
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 <= (-7d+96)) .or. (.not. (rand <= 1.66d+84))) 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 <= -7e+96) || !(rand <= 1.66e+84)) {
tmp = rand * Math.sqrt((a * 0.1111111111111111));
} else {
tmp = a - 0.3333333333333333;
}
return tmp;
}
def code(a, rand): tmp = 0 if (rand <= -7e+96) or not (rand <= 1.66e+84): tmp = rand * math.sqrt((a * 0.1111111111111111)) else: tmp = a - 0.3333333333333333 return tmp
function code(a, rand) tmp = 0.0 if ((rand <= -7e+96) || !(rand <= 1.66e+84)) 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 <= -7e+96) || ~((rand <= 1.66e+84))) tmp = rand * sqrt((a * 0.1111111111111111)); else tmp = a - 0.3333333333333333; end tmp_2 = tmp; end
code[a_, rand_] := If[Or[LessEqual[rand, -7e+96], N[Not[LessEqual[rand, 1.66e+84]], $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 -7 \cdot 10^{+96} \lor \neg \left(rand \leq 1.66 \cdot 10^{+84}\right):\\
\;\;\;\;rand \cdot \sqrt{a \cdot 0.1111111111111111}\\
\mathbf{else}:\\
\;\;\;\;a - 0.3333333333333333\\
\end{array}
\end{array}
if rand < -6.9999999999999998e96 or 1.65999999999999992e84 < rand Initial program 98.5%
sub-neg98.5%
metadata-eval98.5%
metadata-eval98.5%
associate-*l/98.5%
*-lft-identity98.5%
sub-neg98.5%
distribute-lft-in98.5%
metadata-eval98.5%
metadata-eval98.5%
metadata-eval98.5%
Simplified98.5%
Taylor expanded in rand around inf 68.9%
sub-neg68.9%
metadata-eval68.9%
associate-*l*93.7%
*-commutative93.7%
sub-neg93.7%
metadata-eval93.7%
metadata-eval93.7%
distribute-lft-in93.7%
associate-/r*94.7%
metadata-eval94.7%
+-commutative94.7%
+-commutative94.7%
Simplified94.7%
+-commutative94.7%
metadata-eval94.7%
sub-neg94.7%
*-commutative94.7%
sqrt-div94.7%
metadata-eval94.7%
clear-num94.7%
un-div-inv94.7%
sub-neg94.7%
metadata-eval94.7%
+-commutative94.7%
div-inv94.9%
metadata-eval94.9%
Applied egg-rr94.9%
*-un-lft-identity94.9%
*-commutative94.9%
times-frac94.7%
metadata-eval94.7%
pow194.7%
pow1/294.7%
pow-div94.6%
metadata-eval94.6%
+-commutative94.6%
pow1/294.6%
add-sqr-sqrt94.6%
sqrt-unprod94.6%
*-commutative94.6%
+-commutative94.6%
*-commutative94.6%
+-commutative94.6%
swap-sqr94.7%
add-sqr-sqrt94.9%
metadata-eval94.9%
Applied egg-rr94.9%
Taylor expanded in a around inf 92.7%
*-commutative92.7%
Simplified92.7%
if -6.9999999999999998e96 < rand < 1.65999999999999992e84Initial program 99.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 92.6%
Final simplification92.6%
(FPCore (a rand) :precision binary64 (* (+ a -0.3333333333333333) (+ (* rand (sqrt (/ 0.1111111111111111 (+ a -0.3333333333333333)))) 1.0)))
double code(double a, double rand) {
return (a + -0.3333333333333333) * ((rand * sqrt((0.1111111111111111 / (a + -0.3333333333333333)))) + 1.0);
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = (a + (-0.3333333333333333d0)) * ((rand * sqrt((0.1111111111111111d0 / (a + (-0.3333333333333333d0))))) + 1.0d0)
end function
public static double code(double a, double rand) {
return (a + -0.3333333333333333) * ((rand * Math.sqrt((0.1111111111111111 / (a + -0.3333333333333333)))) + 1.0);
}
def code(a, rand): return (a + -0.3333333333333333) * ((rand * math.sqrt((0.1111111111111111 / (a + -0.3333333333333333)))) + 1.0)
function code(a, rand) return Float64(Float64(a + -0.3333333333333333) * Float64(Float64(rand * sqrt(Float64(0.1111111111111111 / Float64(a + -0.3333333333333333)))) + 1.0)) end
function tmp = code(a, rand) tmp = (a + -0.3333333333333333) * ((rand * sqrt((0.1111111111111111 / (a + -0.3333333333333333)))) + 1.0); end
code[a_, rand_] := N[(N[(a + -0.3333333333333333), $MachinePrecision] * N[(N[(rand * N[Sqrt[N[(0.1111111111111111 / N[(a + -0.3333333333333333), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a + -0.3333333333333333\right) \cdot \left(rand \cdot \sqrt{\frac{0.1111111111111111}{a + -0.3333333333333333}} + 1\right)
\end{array}
Initial program 99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
add-sqr-sqrt99.3%
sqrt-unprod99.4%
frac-times99.4%
metadata-eval99.4%
add-sqr-sqrt99.4%
*-commutative99.4%
distribute-rgt-in99.4%
metadata-eval99.4%
fma-def99.4%
Applied egg-rr99.4%
fma-udef99.4%
metadata-eval99.4%
distribute-rgt-in99.4%
associate-/r*99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (a rand) :precision binary64 (* (+ a -0.3333333333333333) (+ (* rand (/ 0.3333333333333333 (sqrt (+ a -0.3333333333333333)))) 1.0)))
double code(double a, double rand) {
return (a + -0.3333333333333333) * ((rand * (0.3333333333333333 / sqrt((a + -0.3333333333333333)))) + 1.0);
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = (a + (-0.3333333333333333d0)) * ((rand * (0.3333333333333333d0 / sqrt((a + (-0.3333333333333333d0))))) + 1.0d0)
end function
public static double code(double a, double rand) {
return (a + -0.3333333333333333) * ((rand * (0.3333333333333333 / Math.sqrt((a + -0.3333333333333333)))) + 1.0);
}
def code(a, rand): return (a + -0.3333333333333333) * ((rand * (0.3333333333333333 / math.sqrt((a + -0.3333333333333333)))) + 1.0)
function code(a, rand) return Float64(Float64(a + -0.3333333333333333) * Float64(Float64(rand * Float64(0.3333333333333333 / sqrt(Float64(a + -0.3333333333333333)))) + 1.0)) end
function tmp = code(a, rand) tmp = (a + -0.3333333333333333) * ((rand * (0.3333333333333333 / sqrt((a + -0.3333333333333333)))) + 1.0); end
code[a_, rand_] := N[(N[(a + -0.3333333333333333), $MachinePrecision] * N[(N[(rand * N[(0.3333333333333333 / N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a + -0.3333333333333333\right) \cdot \left(rand \cdot \frac{0.3333333333333333}{\sqrt{a + -0.3333333333333333}} + 1\right)
\end{array}
Initial program 99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
frac-2neg99.4%
metadata-eval99.4%
div-inv99.4%
sqrt-prod99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
Applied egg-rr99.8%
associate-*r/99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (a rand) :precision binary64 (+ a (- (/ (* rand (sqrt (+ a -0.3333333333333333))) 3.0) 0.3333333333333333)))
double code(double a, double rand) {
return a + (((rand * sqrt((a + -0.3333333333333333))) / 3.0) - 0.3333333333333333);
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = a + (((rand * sqrt((a + (-0.3333333333333333d0)))) / 3.0d0) - 0.3333333333333333d0)
end function
public static double code(double a, double rand) {
return a + (((rand * Math.sqrt((a + -0.3333333333333333))) / 3.0) - 0.3333333333333333);
}
def code(a, rand): return a + (((rand * math.sqrt((a + -0.3333333333333333))) / 3.0) - 0.3333333333333333)
function code(a, rand) return Float64(a + Float64(Float64(Float64(rand * sqrt(Float64(a + -0.3333333333333333))) / 3.0) - 0.3333333333333333)) end
function tmp = code(a, rand) tmp = a + (((rand * sqrt((a + -0.3333333333333333))) / 3.0) - 0.3333333333333333); end
code[a_, rand_] := N[(a + N[(N[(N[(rand * N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision] - 0.3333333333333333), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a + \left(\frac{rand \cdot \sqrt{a + -0.3333333333333333}}{3} - 0.3333333333333333\right)
\end{array}
Initial program 99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
frac-2neg99.4%
metadata-eval99.4%
div-inv99.4%
sqrt-prod99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
Applied egg-rr99.8%
associate-*r/99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
metadata-eval99.8%
sub-neg99.8%
distribute-rgt-in99.8%
*-un-lft-identity99.8%
metadata-eval99.8%
sqrt-div99.8%
*-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
associate-*r*99.8%
associate-+l-99.8%
+-commutative99.8%
metadata-eval99.8%
sub-neg99.8%
*-commutative99.8%
sqrt-div99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-/r*99.8%
pow199.8%
pow1/299.8%
pow-div99.9%
metadata-eval99.9%
pow1/299.9%
associate-*l/99.5%
Applied egg-rr99.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(a - Float64(-0.3333333333333333 * Float64(rand * sqrt(Float64(a - 0.3333333333333333))))) end
function tmp = code(a, rand) tmp = a - (-0.3333333333333333 * (rand * sqrt((a - 0.3333333333333333)))); end
code[a_, rand_] := N[(a - N[(-0.3333333333333333 * N[(rand * N[Sqrt[N[(a - 0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a - -0.3333333333333333 \cdot \left(rand \cdot \sqrt{a - 0.3333333333333333}\right)
\end{array}
Initial program 99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
frac-2neg99.4%
metadata-eval99.4%
div-inv99.4%
sqrt-prod99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
Applied egg-rr99.8%
associate-*r/99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
metadata-eval99.8%
sub-neg99.8%
distribute-rgt-in99.8%
*-un-lft-identity99.8%
metadata-eval99.8%
sqrt-div99.8%
*-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
associate-*r*99.8%
associate-+l-99.8%
+-commutative99.8%
metadata-eval99.8%
sub-neg99.8%
*-commutative99.8%
sqrt-div99.8%
Applied egg-rr99.8%
Taylor expanded in rand around inf 99.0%
Final simplification99.0%
(FPCore (a rand) :precision binary64 (- a (* (sqrt (+ a -0.3333333333333333)) (* rand -0.3333333333333333))))
double code(double a, double rand) {
return a - (sqrt((a + -0.3333333333333333)) * (rand * -0.3333333333333333));
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = a - (sqrt((a + (-0.3333333333333333d0))) * (rand * (-0.3333333333333333d0)))
end function
public static double code(double a, double rand) {
return a - (Math.sqrt((a + -0.3333333333333333)) * (rand * -0.3333333333333333));
}
def code(a, rand): return a - (math.sqrt((a + -0.3333333333333333)) * (rand * -0.3333333333333333))
function code(a, rand) return Float64(a - Float64(sqrt(Float64(a + -0.3333333333333333)) * Float64(rand * -0.3333333333333333))) end
function tmp = code(a, rand) tmp = a - (sqrt((a + -0.3333333333333333)) * (rand * -0.3333333333333333)); end
code[a_, rand_] := N[(a - N[(N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision] * N[(rand * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a - \sqrt{a + -0.3333333333333333} \cdot \left(rand \cdot -0.3333333333333333\right)
\end{array}
Initial program 99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
frac-2neg99.4%
metadata-eval99.4%
div-inv99.4%
sqrt-prod99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
Applied egg-rr99.8%
associate-*r/99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
metadata-eval99.8%
sub-neg99.8%
distribute-rgt-in99.8%
*-un-lft-identity99.8%
metadata-eval99.8%
sqrt-div99.8%
*-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
associate-*r*99.8%
associate-+l-99.8%
+-commutative99.8%
metadata-eval99.8%
sub-neg99.8%
*-commutative99.8%
sqrt-div99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-/r*99.8%
pow199.8%
pow1/299.8%
pow-div99.9%
metadata-eval99.9%
pow1/299.9%
associate-*l/99.5%
Applied egg-rr99.5%
Taylor expanded in rand around inf 99.0%
*-commutative99.0%
*-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
+-commutative99.0%
associate-*l*99.3%
Simplified99.3%
Final simplification99.3%
(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.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 0 59.7%
Final simplification59.7%
(FPCore (a rand) :precision binary64 a)
double code(double a, double rand) {
return a;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = a
end function
public static double code(double a, double rand) {
return a;
}
def code(a, rand): return a
function code(a, rand) return a end
function tmp = code(a, rand) tmp = a; end
code[a_, rand_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 99.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 a around inf 59.3%
Final simplification59.3%
herbie shell --seed 2024029
(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))))