
(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 (+ (/ (* (pow (+ a -0.3333333333333333) 0.5) rand) 3.0) (+ a -0.3333333333333333)))
double code(double a, double rand) {
return ((pow((a + -0.3333333333333333), 0.5) * rand) / 3.0) + (a + -0.3333333333333333);
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = ((((a + (-0.3333333333333333d0)) ** 0.5d0) * rand) / 3.0d0) + (a + (-0.3333333333333333d0))
end function
public static double code(double a, double rand) {
return ((Math.pow((a + -0.3333333333333333), 0.5) * rand) / 3.0) + (a + -0.3333333333333333);
}
def code(a, rand): return ((math.pow((a + -0.3333333333333333), 0.5) * rand) / 3.0) + (a + -0.3333333333333333)
function code(a, rand) return Float64(Float64(Float64((Float64(a + -0.3333333333333333) ^ 0.5) * rand) / 3.0) + Float64(a + -0.3333333333333333)) end
function tmp = code(a, rand) tmp = ((((a + -0.3333333333333333) ^ 0.5) * rand) / 3.0) + (a + -0.3333333333333333); end
code[a_, rand_] := N[(N[(N[(N[Power[N[(a + -0.3333333333333333), $MachinePrecision], 0.5], $MachinePrecision] * rand), $MachinePrecision] / 3.0), $MachinePrecision] + N[(a + -0.3333333333333333), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{{\left(a + -0.3333333333333333\right)}^{0.5} \cdot rand}{3} + \left(a + -0.3333333333333333\right)
\end{array}
Initial program 99.8%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.8%
Simplified99.8%
Taylor expanded in rand around 0
+-commutativeN/A
associate--l+N/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-commutativeN/A
associate-*l*N/A
+-lowering-+.f64N/A
Simplified99.8%
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (* (sqrt (+ a -0.3333333333333333)) (* rand 0.3333333333333333))))
(if (<= rand -4.5e+74)
t_0
(if (<= rand 8.2e+86) (+ a -0.3333333333333333) t_0))))
double code(double a, double rand) {
double t_0 = sqrt((a + -0.3333333333333333)) * (rand * 0.3333333333333333);
double tmp;
if (rand <= -4.5e+74) {
tmp = t_0;
} else if (rand <= 8.2e+86) {
tmp = a + -0.3333333333333333;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a + (-0.3333333333333333d0))) * (rand * 0.3333333333333333d0)
if (rand <= (-4.5d+74)) then
tmp = t_0
else if (rand <= 8.2d+86) then
tmp = a + (-0.3333333333333333d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double rand) {
double t_0 = Math.sqrt((a + -0.3333333333333333)) * (rand * 0.3333333333333333);
double tmp;
if (rand <= -4.5e+74) {
tmp = t_0;
} else if (rand <= 8.2e+86) {
tmp = a + -0.3333333333333333;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, rand): t_0 = math.sqrt((a + -0.3333333333333333)) * (rand * 0.3333333333333333) tmp = 0 if rand <= -4.5e+74: tmp = t_0 elif rand <= 8.2e+86: tmp = a + -0.3333333333333333 else: tmp = t_0 return tmp
function code(a, rand) t_0 = Float64(sqrt(Float64(a + -0.3333333333333333)) * Float64(rand * 0.3333333333333333)) tmp = 0.0 if (rand <= -4.5e+74) tmp = t_0; elseif (rand <= 8.2e+86) tmp = Float64(a + -0.3333333333333333); else tmp = t_0; end return tmp end
function tmp_2 = code(a, rand) t_0 = sqrt((a + -0.3333333333333333)) * (rand * 0.3333333333333333); tmp = 0.0; if (rand <= -4.5e+74) tmp = t_0; elseif (rand <= 8.2e+86) tmp = a + -0.3333333333333333; else tmp = t_0; end tmp_2 = tmp; end
code[a_, rand_] := Block[{t$95$0 = N[(N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision] * N[(rand * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -4.5e+74], t$95$0, If[LessEqual[rand, 8.2e+86], N[(a + -0.3333333333333333), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{a + -0.3333333333333333} \cdot \left(rand \cdot 0.3333333333333333\right)\\
\mathbf{if}\;rand \leq -4.5 \cdot 10^{+74}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;rand \leq 8.2 \cdot 10^{+86}:\\
\;\;\;\;a + -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if rand < -4.5e74 or 8.1999999999999998e86 < rand Initial program 99.6%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.6%
Simplified99.6%
Taylor expanded in rand around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f6496.1%
Simplified96.1%
if -4.5e74 < rand < 8.1999999999999998e86Initial program 99.9%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6495.8%
Simplified95.8%
Final simplification95.9%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (* 0.3333333333333333 (* rand (sqrt a)))))
(if (<= rand -1.05e+76)
t_0
(if (<= rand 2.5e+85) (+ a -0.3333333333333333) t_0))))
double code(double a, double rand) {
double t_0 = 0.3333333333333333 * (rand * sqrt(a));
double tmp;
if (rand <= -1.05e+76) {
tmp = t_0;
} else if (rand <= 2.5e+85) {
tmp = a + -0.3333333333333333;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: t_0
real(8) :: tmp
t_0 = 0.3333333333333333d0 * (rand * sqrt(a))
if (rand <= (-1.05d+76)) then
tmp = t_0
else if (rand <= 2.5d+85) then
tmp = a + (-0.3333333333333333d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double rand) {
double t_0 = 0.3333333333333333 * (rand * Math.sqrt(a));
double tmp;
if (rand <= -1.05e+76) {
tmp = t_0;
} else if (rand <= 2.5e+85) {
tmp = a + -0.3333333333333333;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, rand): t_0 = 0.3333333333333333 * (rand * math.sqrt(a)) tmp = 0 if rand <= -1.05e+76: tmp = t_0 elif rand <= 2.5e+85: tmp = a + -0.3333333333333333 else: tmp = t_0 return tmp
function code(a, rand) t_0 = Float64(0.3333333333333333 * Float64(rand * sqrt(a))) tmp = 0.0 if (rand <= -1.05e+76) tmp = t_0; elseif (rand <= 2.5e+85) tmp = Float64(a + -0.3333333333333333); else tmp = t_0; end return tmp end
function tmp_2 = code(a, rand) t_0 = 0.3333333333333333 * (rand * sqrt(a)); tmp = 0.0; if (rand <= -1.05e+76) tmp = t_0; elseif (rand <= 2.5e+85) tmp = a + -0.3333333333333333; else tmp = t_0; end tmp_2 = tmp; end
code[a_, rand_] := Block[{t$95$0 = N[(0.3333333333333333 * N[(rand * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -1.05e+76], t$95$0, If[LessEqual[rand, 2.5e+85], N[(a + -0.3333333333333333), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)\\
\mathbf{if}\;rand \leq -1.05 \cdot 10^{+76}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;rand \leq 2.5 \cdot 10^{+85}:\\
\;\;\;\;a + -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if rand < -1.05000000000000003e76 or 2.5e85 < rand Initial program 99.6%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6496.7%
Simplified96.7%
Taylor expanded in a around 0
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6493.3%
Simplified93.3%
if -1.05000000000000003e76 < rand < 2.5e85Initial program 99.9%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6495.8%
Simplified95.8%
Final simplification94.8%
(FPCore (a rand) :precision binary64 (+ (+ a -0.3333333333333333) (* (sqrt (+ a -0.3333333333333333)) (* rand 0.3333333333333333))))
double code(double a, double rand) {
return (a + -0.3333333333333333) + (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 + (-0.3333333333333333d0)) + (sqrt((a + (-0.3333333333333333d0))) * (rand * 0.3333333333333333d0))
end function
public static double code(double a, double rand) {
return (a + -0.3333333333333333) + (Math.sqrt((a + -0.3333333333333333)) * (rand * 0.3333333333333333));
}
def code(a, rand): return (a + -0.3333333333333333) + (math.sqrt((a + -0.3333333333333333)) * (rand * 0.3333333333333333))
function code(a, rand) return Float64(Float64(a + -0.3333333333333333) + Float64(sqrt(Float64(a + -0.3333333333333333)) * Float64(rand * 0.3333333333333333))) end
function tmp = code(a, rand) tmp = (a + -0.3333333333333333) + (sqrt((a + -0.3333333333333333)) * (rand * 0.3333333333333333)); end
code[a_, rand_] := N[(N[(a + -0.3333333333333333), $MachinePrecision] + N[(N[Sqrt[N[(a + -0.3333333333333333), $MachinePrecision]], $MachinePrecision] * N[(rand * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a + -0.3333333333333333\right) + \sqrt{a + -0.3333333333333333} \cdot \left(rand \cdot 0.3333333333333333\right)
\end{array}
Initial program 99.8%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.8%
Simplified99.8%
Taylor expanded in rand around 0
+-commutativeN/A
associate--l+N/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-commutativeN/A
associate-*l*N/A
+-lowering-+.f64N/A
Simplified99.8%
Final simplification99.8%
(FPCore (a rand) :precision binary64 (+ a (/ (* (pow (+ a -0.3333333333333333) 0.5) rand) 3.0)))
double code(double a, double rand) {
return a + ((pow((a + -0.3333333333333333), 0.5) * rand) / 3.0);
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = a + ((((a + (-0.3333333333333333d0)) ** 0.5d0) * rand) / 3.0d0)
end function
public static double code(double a, double rand) {
return a + ((Math.pow((a + -0.3333333333333333), 0.5) * rand) / 3.0);
}
def code(a, rand): return a + ((math.pow((a + -0.3333333333333333), 0.5) * rand) / 3.0)
function code(a, rand) return Float64(a + Float64(Float64((Float64(a + -0.3333333333333333) ^ 0.5) * rand) / 3.0)) end
function tmp = code(a, rand) tmp = a + ((((a + -0.3333333333333333) ^ 0.5) * rand) / 3.0); end
code[a_, rand_] := N[(a + N[(N[(N[Power[N[(a + -0.3333333333333333), $MachinePrecision], 0.5], $MachinePrecision] * rand), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a + \frac{{\left(a + -0.3333333333333333\right)}^{0.5} \cdot rand}{3}
\end{array}
Initial program 99.8%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.8%
Simplified99.8%
Taylor expanded in rand around 0
+-commutativeN/A
associate--l+N/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-commutativeN/A
associate-*l*N/A
+-lowering-+.f64N/A
Simplified99.8%
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Taylor expanded in a around inf
Simplified99.4%
Final simplification99.4%
(FPCore (a rand) :precision binary64 (+ a (* (/ rand 3.0) (sqrt a))))
double code(double a, double rand) {
return a + ((rand / 3.0) * sqrt(a));
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = a + ((rand / 3.0d0) * sqrt(a))
end function
public static double code(double a, double rand) {
return a + ((rand / 3.0) * Math.sqrt(a));
}
def code(a, rand): return a + ((rand / 3.0) * math.sqrt(a))
function code(a, rand) return Float64(a + Float64(Float64(rand / 3.0) * sqrt(a))) end
function tmp = code(a, rand) tmp = a + ((rand / 3.0) * sqrt(a)); end
code[a_, rand_] := N[(a + N[(N[(rand / 3.0), $MachinePrecision] * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a + \frac{rand}{3} \cdot \sqrt{a}
\end{array}
Initial program 99.8%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6498.1%
Simplified98.1%
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*l*N/A
pow1/2N/A
inv-powN/A
pow-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
pow1/2N/A
*-lowering-*.f64N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6498.2%
Applied egg-rr98.2%
Final simplification98.2%
(FPCore (a rand) :precision binary64 (+ a (* 0.3333333333333333 (* rand (sqrt a)))))
double code(double a, double rand) {
return a + (0.3333333333333333 * (rand * sqrt(a)));
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = a + (0.3333333333333333d0 * (rand * sqrt(a)))
end function
public static double code(double a, double rand) {
return a + (0.3333333333333333 * (rand * Math.sqrt(a)));
}
def code(a, rand): return a + (0.3333333333333333 * (rand * math.sqrt(a)))
function code(a, rand) return Float64(a + Float64(0.3333333333333333 * Float64(rand * sqrt(a)))) end
function tmp = code(a, rand) tmp = a + (0.3333333333333333 * (rand * sqrt(a))); end
code[a_, rand_] := N[(a + N[(0.3333333333333333 * N[(rand * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a + 0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)
\end{array}
Initial program 99.8%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6498.1%
Simplified98.1%
Taylor expanded in a around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6498.2%
Simplified98.2%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (- 0.1111111111111111 (* a a))))
(if (<= rand -7.2e+114)
(* t_0 (+ (* a (+ 9.0 (* a (+ -27.0 (* a 81.0))))) -3.0))
(if (<= rand 1.4e+129)
(+ a -0.3333333333333333)
(* t_0 (+ -3.0 (* a (+ 9.0 (* a -27.0)))))))))
double code(double a, double rand) {
double t_0 = 0.1111111111111111 - (a * a);
double tmp;
if (rand <= -7.2e+114) {
tmp = t_0 * ((a * (9.0 + (a * (-27.0 + (a * 81.0))))) + -3.0);
} else if (rand <= 1.4e+129) {
tmp = a + -0.3333333333333333;
} else {
tmp = t_0 * (-3.0 + (a * (9.0 + (a * -27.0))));
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: t_0
real(8) :: tmp
t_0 = 0.1111111111111111d0 - (a * a)
if (rand <= (-7.2d+114)) then
tmp = t_0 * ((a * (9.0d0 + (a * ((-27.0d0) + (a * 81.0d0))))) + (-3.0d0))
else if (rand <= 1.4d+129) then
tmp = a + (-0.3333333333333333d0)
else
tmp = t_0 * ((-3.0d0) + (a * (9.0d0 + (a * (-27.0d0)))))
end if
code = tmp
end function
public static double code(double a, double rand) {
double t_0 = 0.1111111111111111 - (a * a);
double tmp;
if (rand <= -7.2e+114) {
tmp = t_0 * ((a * (9.0 + (a * (-27.0 + (a * 81.0))))) + -3.0);
} else if (rand <= 1.4e+129) {
tmp = a + -0.3333333333333333;
} else {
tmp = t_0 * (-3.0 + (a * (9.0 + (a * -27.0))));
}
return tmp;
}
def code(a, rand): t_0 = 0.1111111111111111 - (a * a) tmp = 0 if rand <= -7.2e+114: tmp = t_0 * ((a * (9.0 + (a * (-27.0 + (a * 81.0))))) + -3.0) elif rand <= 1.4e+129: tmp = a + -0.3333333333333333 else: tmp = t_0 * (-3.0 + (a * (9.0 + (a * -27.0)))) return tmp
function code(a, rand) t_0 = Float64(0.1111111111111111 - Float64(a * a)) tmp = 0.0 if (rand <= -7.2e+114) tmp = Float64(t_0 * Float64(Float64(a * Float64(9.0 + Float64(a * Float64(-27.0 + Float64(a * 81.0))))) + -3.0)); elseif (rand <= 1.4e+129) tmp = Float64(a + -0.3333333333333333); else tmp = Float64(t_0 * Float64(-3.0 + Float64(a * Float64(9.0 + Float64(a * -27.0))))); end return tmp end
function tmp_2 = code(a, rand) t_0 = 0.1111111111111111 - (a * a); tmp = 0.0; if (rand <= -7.2e+114) tmp = t_0 * ((a * (9.0 + (a * (-27.0 + (a * 81.0))))) + -3.0); elseif (rand <= 1.4e+129) tmp = a + -0.3333333333333333; else tmp = t_0 * (-3.0 + (a * (9.0 + (a * -27.0)))); end tmp_2 = tmp; end
code[a_, rand_] := Block[{t$95$0 = N[(0.1111111111111111 - N[(a * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -7.2e+114], N[(t$95$0 * N[(N[(a * N[(9.0 + N[(a * N[(-27.0 + N[(a * 81.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 1.4e+129], N[(a + -0.3333333333333333), $MachinePrecision], N[(t$95$0 * N[(-3.0 + N[(a * N[(9.0 + N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.1111111111111111 - a \cdot a\\
\mathbf{if}\;rand \leq -7.2 \cdot 10^{+114}:\\
\;\;\;\;t\_0 \cdot \left(a \cdot \left(9 + a \cdot \left(-27 + a \cdot 81\right)\right) + -3\right)\\
\mathbf{elif}\;rand \leq 1.4 \cdot 10^{+129}:\\
\;\;\;\;a + -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(-3 + a \cdot \left(9 + a \cdot -27\right)\right)\\
\end{array}
\end{array}
if rand < -7.2000000000000001e114Initial program 99.6%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.6%
Simplified99.6%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f640.4%
Simplified0.4%
flip-+N/A
div-invN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f640.3%
Applied egg-rr0.3%
Taylor expanded in a around 0
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval50.9%
Simplified50.9%
if -7.2000000000000001e114 < rand < 1.39999999999999987e129Initial program 99.9%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6488.3%
Simplified88.3%
if 1.39999999999999987e129 < rand Initial program 99.6%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.6%
Simplified99.6%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f645.2%
Simplified5.2%
flip-+N/A
div-invN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6427.0%
Applied egg-rr27.0%
Taylor expanded in a around 0
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval36.1%
Simplified36.1%
Final simplification73.2%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (- 0.1111111111111111 (* a a))))
(if (<= rand -7.2e+114)
(* t_0 (+ -3.0 (* a 9.0)))
(if (<= rand 1.4e+129)
(+ a -0.3333333333333333)
(* t_0 (+ -3.0 (* a (+ 9.0 (* a -27.0)))))))))
double code(double a, double rand) {
double t_0 = 0.1111111111111111 - (a * a);
double tmp;
if (rand <= -7.2e+114) {
tmp = t_0 * (-3.0 + (a * 9.0));
} else if (rand <= 1.4e+129) {
tmp = a + -0.3333333333333333;
} else {
tmp = t_0 * (-3.0 + (a * (9.0 + (a * -27.0))));
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: t_0
real(8) :: tmp
t_0 = 0.1111111111111111d0 - (a * a)
if (rand <= (-7.2d+114)) then
tmp = t_0 * ((-3.0d0) + (a * 9.0d0))
else if (rand <= 1.4d+129) then
tmp = a + (-0.3333333333333333d0)
else
tmp = t_0 * ((-3.0d0) + (a * (9.0d0 + (a * (-27.0d0)))))
end if
code = tmp
end function
public static double code(double a, double rand) {
double t_0 = 0.1111111111111111 - (a * a);
double tmp;
if (rand <= -7.2e+114) {
tmp = t_0 * (-3.0 + (a * 9.0));
} else if (rand <= 1.4e+129) {
tmp = a + -0.3333333333333333;
} else {
tmp = t_0 * (-3.0 + (a * (9.0 + (a * -27.0))));
}
return tmp;
}
def code(a, rand): t_0 = 0.1111111111111111 - (a * a) tmp = 0 if rand <= -7.2e+114: tmp = t_0 * (-3.0 + (a * 9.0)) elif rand <= 1.4e+129: tmp = a + -0.3333333333333333 else: tmp = t_0 * (-3.0 + (a * (9.0 + (a * -27.0)))) return tmp
function code(a, rand) t_0 = Float64(0.1111111111111111 - Float64(a * a)) tmp = 0.0 if (rand <= -7.2e+114) tmp = Float64(t_0 * Float64(-3.0 + Float64(a * 9.0))); elseif (rand <= 1.4e+129) tmp = Float64(a + -0.3333333333333333); else tmp = Float64(t_0 * Float64(-3.0 + Float64(a * Float64(9.0 + Float64(a * -27.0))))); end return tmp end
function tmp_2 = code(a, rand) t_0 = 0.1111111111111111 - (a * a); tmp = 0.0; if (rand <= -7.2e+114) tmp = t_0 * (-3.0 + (a * 9.0)); elseif (rand <= 1.4e+129) tmp = a + -0.3333333333333333; else tmp = t_0 * (-3.0 + (a * (9.0 + (a * -27.0)))); end tmp_2 = tmp; end
code[a_, rand_] := Block[{t$95$0 = N[(0.1111111111111111 - N[(a * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -7.2e+114], N[(t$95$0 * N[(-3.0 + N[(a * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 1.4e+129], N[(a + -0.3333333333333333), $MachinePrecision], N[(t$95$0 * N[(-3.0 + N[(a * N[(9.0 + N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.1111111111111111 - a \cdot a\\
\mathbf{if}\;rand \leq -7.2 \cdot 10^{+114}:\\
\;\;\;\;t\_0 \cdot \left(-3 + a \cdot 9\right)\\
\mathbf{elif}\;rand \leq 1.4 \cdot 10^{+129}:\\
\;\;\;\;a + -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(-3 + a \cdot \left(9 + a \cdot -27\right)\right)\\
\end{array}
\end{array}
if rand < -7.2000000000000001e114Initial program 99.6%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.6%
Simplified99.6%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f640.4%
Simplified0.4%
flip-+N/A
div-invN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f640.3%
Applied egg-rr0.3%
Taylor expanded in a around 0
sub-negN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval48.6%
Simplified48.6%
if -7.2000000000000001e114 < rand < 1.39999999999999987e129Initial program 99.9%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6488.3%
Simplified88.3%
if 1.39999999999999987e129 < rand Initial program 99.6%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.6%
Simplified99.6%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f645.2%
Simplified5.2%
flip-+N/A
div-invN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6427.0%
Applied egg-rr27.0%
Taylor expanded in a around 0
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval36.1%
Simplified36.1%
Final simplification72.9%
(FPCore (a rand)
:precision binary64
(if (<= rand -7.2e+114)
(* (- 0.1111111111111111 (* a a)) (+ -3.0 (* a 9.0)))
(if (<= rand 1.4e+129)
(+ a -0.3333333333333333)
(/
(+ (* a (* a a)) -0.037037037037037035)
(+ 0.1111111111111111 (* a 0.3333333333333333))))))
double code(double a, double rand) {
double tmp;
if (rand <= -7.2e+114) {
tmp = (0.1111111111111111 - (a * a)) * (-3.0 + (a * 9.0));
} else if (rand <= 1.4e+129) {
tmp = a + -0.3333333333333333;
} else {
tmp = ((a * (a * a)) + -0.037037037037037035) / (0.1111111111111111 + (a * 0.3333333333333333));
}
return tmp;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
real(8) :: tmp
if (rand <= (-7.2d+114)) then
tmp = (0.1111111111111111d0 - (a * a)) * ((-3.0d0) + (a * 9.0d0))
else if (rand <= 1.4d+129) then
tmp = a + (-0.3333333333333333d0)
else
tmp = ((a * (a * a)) + (-0.037037037037037035d0)) / (0.1111111111111111d0 + (a * 0.3333333333333333d0))
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if (rand <= -7.2e+114) {
tmp = (0.1111111111111111 - (a * a)) * (-3.0 + (a * 9.0));
} else if (rand <= 1.4e+129) {
tmp = a + -0.3333333333333333;
} else {
tmp = ((a * (a * a)) + -0.037037037037037035) / (0.1111111111111111 + (a * 0.3333333333333333));
}
return tmp;
}
def code(a, rand): tmp = 0 if rand <= -7.2e+114: tmp = (0.1111111111111111 - (a * a)) * (-3.0 + (a * 9.0)) elif rand <= 1.4e+129: tmp = a + -0.3333333333333333 else: tmp = ((a * (a * a)) + -0.037037037037037035) / (0.1111111111111111 + (a * 0.3333333333333333)) return tmp
function code(a, rand) tmp = 0.0 if (rand <= -7.2e+114) tmp = Float64(Float64(0.1111111111111111 - Float64(a * a)) * Float64(-3.0 + Float64(a * 9.0))); elseif (rand <= 1.4e+129) tmp = Float64(a + -0.3333333333333333); else tmp = Float64(Float64(Float64(a * Float64(a * a)) + -0.037037037037037035) / Float64(0.1111111111111111 + Float64(a * 0.3333333333333333))); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if (rand <= -7.2e+114) tmp = (0.1111111111111111 - (a * a)) * (-3.0 + (a * 9.0)); elseif (rand <= 1.4e+129) tmp = a + -0.3333333333333333; else tmp = ((a * (a * a)) + -0.037037037037037035) / (0.1111111111111111 + (a * 0.3333333333333333)); end tmp_2 = tmp; end
code[a_, rand_] := If[LessEqual[rand, -7.2e+114], N[(N[(0.1111111111111111 - N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(-3.0 + N[(a * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 1.4e+129], N[(a + -0.3333333333333333), $MachinePrecision], N[(N[(N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision] + -0.037037037037037035), $MachinePrecision] / N[(0.1111111111111111 + N[(a * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -7.2 \cdot 10^{+114}:\\
\;\;\;\;\left(0.1111111111111111 - a \cdot a\right) \cdot \left(-3 + a \cdot 9\right)\\
\mathbf{elif}\;rand \leq 1.4 \cdot 10^{+129}:\\
\;\;\;\;a + -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{a \cdot \left(a \cdot a\right) + -0.037037037037037035}{0.1111111111111111 + a \cdot 0.3333333333333333}\\
\end{array}
\end{array}
if rand < -7.2000000000000001e114Initial program 99.6%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.6%
Simplified99.6%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f640.4%
Simplified0.4%
flip-+N/A
div-invN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f640.3%
Applied egg-rr0.3%
Taylor expanded in a around 0
sub-negN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval48.6%
Simplified48.6%
if -7.2000000000000001e114 < rand < 1.39999999999999987e129Initial program 99.9%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6488.3%
Simplified88.3%
if 1.39999999999999987e129 < rand Initial program 99.6%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.6%
Simplified99.6%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f645.2%
Simplified5.2%
flip3-+N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
cube-multN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-lowering-+.f64N/A
metadata-evalN/A
distribute-rgt-out--N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6411.3%
Applied egg-rr11.3%
Taylor expanded in a around 0
*-lowering-*.f6435.9%
Simplified35.9%
Final simplification72.9%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (- 0.1111111111111111 (* a a))))
(if (<= rand -6.2e+114)
(* t_0 (+ -3.0 (* a 9.0)))
(if (<= rand 1.4e+129) (+ a -0.3333333333333333) (* t_0 -3.0)))))
double code(double a, double rand) {
double t_0 = 0.1111111111111111 - (a * a);
double tmp;
if (rand <= -6.2e+114) {
tmp = t_0 * (-3.0 + (a * 9.0));
} else if (rand <= 1.4e+129) {
tmp = a + -0.3333333333333333;
} else {
tmp = 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 = 0.1111111111111111d0 - (a * a)
if (rand <= (-6.2d+114)) then
tmp = t_0 * ((-3.0d0) + (a * 9.0d0))
else if (rand <= 1.4d+129) then
tmp = a + (-0.3333333333333333d0)
else
tmp = t_0 * (-3.0d0)
end if
code = tmp
end function
public static double code(double a, double rand) {
double t_0 = 0.1111111111111111 - (a * a);
double tmp;
if (rand <= -6.2e+114) {
tmp = t_0 * (-3.0 + (a * 9.0));
} else if (rand <= 1.4e+129) {
tmp = a + -0.3333333333333333;
} else {
tmp = t_0 * -3.0;
}
return tmp;
}
def code(a, rand): t_0 = 0.1111111111111111 - (a * a) tmp = 0 if rand <= -6.2e+114: tmp = t_0 * (-3.0 + (a * 9.0)) elif rand <= 1.4e+129: tmp = a + -0.3333333333333333 else: tmp = t_0 * -3.0 return tmp
function code(a, rand) t_0 = Float64(0.1111111111111111 - Float64(a * a)) tmp = 0.0 if (rand <= -6.2e+114) tmp = Float64(t_0 * Float64(-3.0 + Float64(a * 9.0))); elseif (rand <= 1.4e+129) tmp = Float64(a + -0.3333333333333333); else tmp = Float64(t_0 * -3.0); end return tmp end
function tmp_2 = code(a, rand) t_0 = 0.1111111111111111 - (a * a); tmp = 0.0; if (rand <= -6.2e+114) tmp = t_0 * (-3.0 + (a * 9.0)); elseif (rand <= 1.4e+129) tmp = a + -0.3333333333333333; else tmp = t_0 * -3.0; end tmp_2 = tmp; end
code[a_, rand_] := Block[{t$95$0 = N[(0.1111111111111111 - N[(a * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -6.2e+114], N[(t$95$0 * N[(-3.0 + N[(a * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 1.4e+129], N[(a + -0.3333333333333333), $MachinePrecision], N[(t$95$0 * -3.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.1111111111111111 - a \cdot a\\
\mathbf{if}\;rand \leq -6.2 \cdot 10^{+114}:\\
\;\;\;\;t\_0 \cdot \left(-3 + a \cdot 9\right)\\
\mathbf{elif}\;rand \leq 1.4 \cdot 10^{+129}:\\
\;\;\;\;a + -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot -3\\
\end{array}
\end{array}
if rand < -6.2000000000000001e114Initial program 99.6%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.6%
Simplified99.6%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f640.4%
Simplified0.4%
flip-+N/A
div-invN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f640.3%
Applied egg-rr0.3%
Taylor expanded in a around 0
sub-negN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval48.6%
Simplified48.6%
if -6.2000000000000001e114 < rand < 1.39999999999999987e129Initial program 99.9%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6488.3%
Simplified88.3%
if 1.39999999999999987e129 < rand Initial program 99.6%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.6%
Simplified99.6%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f645.2%
Simplified5.2%
flip-+N/A
div-invN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6427.0%
Applied egg-rr27.0%
Taylor expanded in a around 0
Simplified28.3%
Final simplification71.4%
(FPCore (a rand) :precision binary64 (if (<= rand 6.5e+128) (+ a -0.3333333333333333) (* (- 0.1111111111111111 (* a a)) -3.0)))
double code(double a, double rand) {
double tmp;
if (rand <= 6.5e+128) {
tmp = a + -0.3333333333333333;
} else {
tmp = (0.1111111111111111 - (a * 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 <= 6.5d+128) then
tmp = a + (-0.3333333333333333d0)
else
tmp = (0.1111111111111111d0 - (a * a)) * (-3.0d0)
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if (rand <= 6.5e+128) {
tmp = a + -0.3333333333333333;
} else {
tmp = (0.1111111111111111 - (a * a)) * -3.0;
}
return tmp;
}
def code(a, rand): tmp = 0 if rand <= 6.5e+128: tmp = a + -0.3333333333333333 else: tmp = (0.1111111111111111 - (a * a)) * -3.0 return tmp
function code(a, rand) tmp = 0.0 if (rand <= 6.5e+128) tmp = Float64(a + -0.3333333333333333); else tmp = Float64(Float64(0.1111111111111111 - Float64(a * a)) * -3.0); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if (rand <= 6.5e+128) tmp = a + -0.3333333333333333; else tmp = (0.1111111111111111 - (a * a)) * -3.0; end tmp_2 = tmp; end
code[a_, rand_] := If[LessEqual[rand, 6.5e+128], N[(a + -0.3333333333333333), $MachinePrecision], N[(N[(0.1111111111111111 - N[(a * a), $MachinePrecision]), $MachinePrecision] * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq 6.5 \cdot 10^{+128}:\\
\;\;\;\;a + -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\left(0.1111111111111111 - a \cdot a\right) \cdot -3\\
\end{array}
\end{array}
if rand < 6.5000000000000003e128Initial program 99.9%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6473.1%
Simplified73.1%
if 6.5000000000000003e128 < rand Initial program 99.6%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.6%
Simplified99.6%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f645.2%
Simplified5.2%
flip-+N/A
div-invN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6427.0%
Applied egg-rr27.0%
Taylor expanded in a around 0
Simplified28.3%
Final simplification64.7%
(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%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.8%
Simplified99.8%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6460.3%
Simplified60.3%
Final simplification60.3%
(FPCore (a rand) :precision binary64 a)
double code(double a, double rand) {
return a;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = a
end function
public static double code(double a, double rand) {
return a;
}
def code(a, rand): return a
function code(a, rand) return a end
function tmp = code(a, rand) tmp = a; end
code[a_, rand_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 99.8%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.8%
Simplified99.8%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6460.3%
Simplified60.3%
Taylor expanded in a around inf
Simplified59.8%
(FPCore (a rand) :precision binary64 -0.3333333333333333)
double code(double a, double rand) {
return -0.3333333333333333;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = -0.3333333333333333d0
end function
public static double code(double a, double rand) {
return -0.3333333333333333;
}
def code(a, rand): return -0.3333333333333333
function code(a, rand) return -0.3333333333333333 end
function tmp = code(a, rand) tmp = -0.3333333333333333; end
code[a_, rand_] := -0.3333333333333333
\begin{array}{l}
\\
-0.3333333333333333
\end{array}
Initial program 99.8%
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-eval99.8%
Simplified99.8%
Taylor expanded in rand around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6460.3%
Simplified60.3%
Taylor expanded in a around 0
Simplified1.5%
herbie shell --seed 2024154
(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))))