
(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 14 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 a) (* (sqrt (+ -0.3333333333333333 a)) (* 0.3333333333333333 rand))))
double code(double a, double rand) {
return (-0.3333333333333333 + a) + (sqrt((-0.3333333333333333 + a)) * (0.3333333333333333 * rand));
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = ((-0.3333333333333333d0) + a) + (sqrt(((-0.3333333333333333d0) + a)) * (0.3333333333333333d0 * rand))
end function
public static double code(double a, double rand) {
return (-0.3333333333333333 + a) + (Math.sqrt((-0.3333333333333333 + a)) * (0.3333333333333333 * rand));
}
def code(a, rand): return (-0.3333333333333333 + a) + (math.sqrt((-0.3333333333333333 + a)) * (0.3333333333333333 * rand))
function code(a, rand) return Float64(Float64(-0.3333333333333333 + a) + Float64(sqrt(Float64(-0.3333333333333333 + a)) * Float64(0.3333333333333333 * rand))) end
function tmp = code(a, rand) tmp = (-0.3333333333333333 + a) + (sqrt((-0.3333333333333333 + a)) * (0.3333333333333333 * rand)); end
code[a_, rand_] := N[(N[(-0.3333333333333333 + a), $MachinePrecision] + N[(N[Sqrt[N[(-0.3333333333333333 + a), $MachinePrecision]], $MachinePrecision] * N[(0.3333333333333333 * rand), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-0.3333333333333333 + a\right) + \sqrt{-0.3333333333333333 + a} \cdot \left(0.3333333333333333 \cdot rand\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
(let* ((t_0 (* (sqrt (+ -0.3333333333333333 a)) (/ rand 3.0))))
(if (<= rand -7.8e+89)
t_0
(if (<= rand 2.2e+76) (+ -0.3333333333333333 a) t_0))))
double code(double a, double rand) {
double t_0 = sqrt((-0.3333333333333333 + a)) * (rand / 3.0);
double tmp;
if (rand <= -7.8e+89) {
tmp = t_0;
} else if (rand <= 2.2e+76) {
tmp = -0.3333333333333333 + a;
} 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(((-0.3333333333333333d0) + a)) * (rand / 3.0d0)
if (rand <= (-7.8d+89)) then
tmp = t_0
else if (rand <= 2.2d+76) then
tmp = (-0.3333333333333333d0) + a
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double rand) {
double t_0 = Math.sqrt((-0.3333333333333333 + a)) * (rand / 3.0);
double tmp;
if (rand <= -7.8e+89) {
tmp = t_0;
} else if (rand <= 2.2e+76) {
tmp = -0.3333333333333333 + a;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, rand): t_0 = math.sqrt((-0.3333333333333333 + a)) * (rand / 3.0) tmp = 0 if rand <= -7.8e+89: tmp = t_0 elif rand <= 2.2e+76: tmp = -0.3333333333333333 + a else: tmp = t_0 return tmp
function code(a, rand) t_0 = Float64(sqrt(Float64(-0.3333333333333333 + a)) * Float64(rand / 3.0)) tmp = 0.0 if (rand <= -7.8e+89) tmp = t_0; elseif (rand <= 2.2e+76) tmp = Float64(-0.3333333333333333 + a); else tmp = t_0; end return tmp end
function tmp_2 = code(a, rand) t_0 = sqrt((-0.3333333333333333 + a)) * (rand / 3.0); tmp = 0.0; if (rand <= -7.8e+89) tmp = t_0; elseif (rand <= 2.2e+76) tmp = -0.3333333333333333 + a; else tmp = t_0; end tmp_2 = tmp; end
code[a_, rand_] := Block[{t$95$0 = N[(N[Sqrt[N[(-0.3333333333333333 + a), $MachinePrecision]], $MachinePrecision] * N[(rand / 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -7.8e+89], t$95$0, If[LessEqual[rand, 2.2e+76], N[(-0.3333333333333333 + a), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-0.3333333333333333 + a} \cdot \frac{rand}{3}\\
\mathbf{if}\;rand \leq -7.8 \cdot 10^{+89}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;rand \leq 2.2 \cdot 10^{+76}:\\
\;\;\;\;-0.3333333333333333 + a\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if rand < -7.80000000000000021e89 or 2.2e76 < rand Initial program 99.5%
*-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.5%
Simplified99.5%
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-*.f6491.0%
Simplified91.0%
*-commutativeN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f6491.1%
Applied egg-rr91.1%
if -7.80000000000000021e89 < rand < 2.2e76Initial 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-+.f6493.5%
Simplified93.5%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (* (sqrt (+ -0.3333333333333333 a)) (* 0.3333333333333333 rand))))
(if (<= rand -8.8e+89)
t_0
(if (<= rand 2.15e+76) (+ -0.3333333333333333 a) t_0))))
double code(double a, double rand) {
double t_0 = sqrt((-0.3333333333333333 + a)) * (0.3333333333333333 * rand);
double tmp;
if (rand <= -8.8e+89) {
tmp = t_0;
} else if (rand <= 2.15e+76) {
tmp = -0.3333333333333333 + a;
} 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(((-0.3333333333333333d0) + a)) * (0.3333333333333333d0 * rand)
if (rand <= (-8.8d+89)) then
tmp = t_0
else if (rand <= 2.15d+76) then
tmp = (-0.3333333333333333d0) + a
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double rand) {
double t_0 = Math.sqrt((-0.3333333333333333 + a)) * (0.3333333333333333 * rand);
double tmp;
if (rand <= -8.8e+89) {
tmp = t_0;
} else if (rand <= 2.15e+76) {
tmp = -0.3333333333333333 + a;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, rand): t_0 = math.sqrt((-0.3333333333333333 + a)) * (0.3333333333333333 * rand) tmp = 0 if rand <= -8.8e+89: tmp = t_0 elif rand <= 2.15e+76: tmp = -0.3333333333333333 + a else: tmp = t_0 return tmp
function code(a, rand) t_0 = Float64(sqrt(Float64(-0.3333333333333333 + a)) * Float64(0.3333333333333333 * rand)) tmp = 0.0 if (rand <= -8.8e+89) tmp = t_0; elseif (rand <= 2.15e+76) tmp = Float64(-0.3333333333333333 + a); else tmp = t_0; end return tmp end
function tmp_2 = code(a, rand) t_0 = sqrt((-0.3333333333333333 + a)) * (0.3333333333333333 * rand); tmp = 0.0; if (rand <= -8.8e+89) tmp = t_0; elseif (rand <= 2.15e+76) tmp = -0.3333333333333333 + a; else tmp = t_0; end tmp_2 = tmp; end
code[a_, rand_] := Block[{t$95$0 = N[(N[Sqrt[N[(-0.3333333333333333 + a), $MachinePrecision]], $MachinePrecision] * N[(0.3333333333333333 * rand), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[rand, -8.8e+89], t$95$0, If[LessEqual[rand, 2.15e+76], N[(-0.3333333333333333 + a), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-0.3333333333333333 + a} \cdot \left(0.3333333333333333 \cdot rand\right)\\
\mathbf{if}\;rand \leq -8.8 \cdot 10^{+89}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;rand \leq 2.15 \cdot 10^{+76}:\\
\;\;\;\;-0.3333333333333333 + a\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if rand < -8.8000000000000001e89 or 2.14999999999999989e76 < rand Initial program 99.5%
*-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.5%
Simplified99.5%
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-*.f6491.0%
Simplified91.0%
if -8.8000000000000001e89 < rand < 2.14999999999999989e76Initial 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-+.f6493.5%
Simplified93.5%
(FPCore (a rand) :precision binary64 (if (<= rand -2.3e+94) (* 0.3333333333333333 (* rand (sqrt a))) (if (<= rand 4.3e+75) (+ -0.3333333333333333 a) (* (sqrt a) (/ rand 3.0)))))
double code(double a, double rand) {
double tmp;
if (rand <= -2.3e+94) {
tmp = 0.3333333333333333 * (rand * sqrt(a));
} else if (rand <= 4.3e+75) {
tmp = -0.3333333333333333 + a;
} else {
tmp = sqrt(a) * (rand / 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 <= (-2.3d+94)) then
tmp = 0.3333333333333333d0 * (rand * sqrt(a))
else if (rand <= 4.3d+75) then
tmp = (-0.3333333333333333d0) + a
else
tmp = sqrt(a) * (rand / 3.0d0)
end if
code = tmp
end function
public static double code(double a, double rand) {
double tmp;
if (rand <= -2.3e+94) {
tmp = 0.3333333333333333 * (rand * Math.sqrt(a));
} else if (rand <= 4.3e+75) {
tmp = -0.3333333333333333 + a;
} else {
tmp = Math.sqrt(a) * (rand / 3.0);
}
return tmp;
}
def code(a, rand): tmp = 0 if rand <= -2.3e+94: tmp = 0.3333333333333333 * (rand * math.sqrt(a)) elif rand <= 4.3e+75: tmp = -0.3333333333333333 + a else: tmp = math.sqrt(a) * (rand / 3.0) return tmp
function code(a, rand) tmp = 0.0 if (rand <= -2.3e+94) tmp = Float64(0.3333333333333333 * Float64(rand * sqrt(a))); elseif (rand <= 4.3e+75) tmp = Float64(-0.3333333333333333 + a); else tmp = Float64(sqrt(a) * Float64(rand / 3.0)); end return tmp end
function tmp_2 = code(a, rand) tmp = 0.0; if (rand <= -2.3e+94) tmp = 0.3333333333333333 * (rand * sqrt(a)); elseif (rand <= 4.3e+75) tmp = -0.3333333333333333 + a; else tmp = sqrt(a) * (rand / 3.0); end tmp_2 = tmp; end
code[a_, rand_] := If[LessEqual[rand, -2.3e+94], N[(0.3333333333333333 * N[(rand * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 4.3e+75], N[(-0.3333333333333333 + a), $MachinePrecision], N[(N[Sqrt[a], $MachinePrecision] * N[(rand / 3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq -2.3 \cdot 10^{+94}:\\
\;\;\;\;0.3333333333333333 \cdot \left(rand \cdot \sqrt{a}\right)\\
\mathbf{elif}\;rand \leq 4.3 \cdot 10^{+75}:\\
\;\;\;\;-0.3333333333333333 + a\\
\mathbf{else}:\\
\;\;\;\;\sqrt{a} \cdot \frac{rand}{3}\\
\end{array}
\end{array}
if rand < -2.3e94Initial 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-*.f6488.5%
Simplified88.5%
Taylor expanded in a around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6485.2%
Simplified85.2%
if -2.3e94 < rand < 4.3000000000000001e75Initial 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-+.f6492.9%
Simplified92.9%
if 4.3000000000000001e75 < rand Initial program 99.5%
*-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.4%
Simplified99.4%
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-*.f6495.7%
Simplified95.7%
*-commutativeN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f6495.9%
Applied egg-rr95.9%
Taylor expanded in a around inf
sqrt-lowering-sqrt.f6494.1%
Simplified94.1%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (* 0.3333333333333333 (* rand (sqrt a)))))
(if (<= rand -2.1e+94)
t_0
(if (<= rand 3.2e+75) (+ -0.3333333333333333 a) t_0))))
double code(double a, double rand) {
double t_0 = 0.3333333333333333 * (rand * sqrt(a));
double tmp;
if (rand <= -2.1e+94) {
tmp = t_0;
} else if (rand <= 3.2e+75) {
tmp = -0.3333333333333333 + a;
} 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 <= (-2.1d+94)) then
tmp = t_0
else if (rand <= 3.2d+75) then
tmp = (-0.3333333333333333d0) + a
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 <= -2.1e+94) {
tmp = t_0;
} else if (rand <= 3.2e+75) {
tmp = -0.3333333333333333 + a;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, rand): t_0 = 0.3333333333333333 * (rand * math.sqrt(a)) tmp = 0 if rand <= -2.1e+94: tmp = t_0 elif rand <= 3.2e+75: tmp = -0.3333333333333333 + a else: tmp = t_0 return tmp
function code(a, rand) t_0 = Float64(0.3333333333333333 * Float64(rand * sqrt(a))) tmp = 0.0 if (rand <= -2.1e+94) tmp = t_0; elseif (rand <= 3.2e+75) tmp = Float64(-0.3333333333333333 + a); 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 <= -2.1e+94) tmp = t_0; elseif (rand <= 3.2e+75) tmp = -0.3333333333333333 + a; 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, -2.1e+94], t$95$0, If[LessEqual[rand, 3.2e+75], N[(-0.3333333333333333 + a), $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 -2.1 \cdot 10^{+94}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;rand \leq 3.2 \cdot 10^{+75}:\\
\;\;\;\;-0.3333333333333333 + a\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if rand < -2.09999999999999989e94 or 3.19999999999999985e75 < 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.5%
Simplified99.5%
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-*.f6491.8%
Simplified91.8%
Taylor expanded in a around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6489.2%
Simplified89.2%
if -2.09999999999999989e94 < rand < 3.19999999999999985e75Initial 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-+.f6492.9%
Simplified92.9%
(FPCore (a rand) :precision binary64 (* (+ -0.3333333333333333 a) (+ 1.0 (/ rand (* 3.0 (sqrt a))))))
double code(double a, double rand) {
return (-0.3333333333333333 + a) * (1.0 + (rand / (3.0 * sqrt(a))));
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = ((-0.3333333333333333d0) + a) * (1.0d0 + (rand / (3.0d0 * sqrt(a))))
end function
public static double code(double a, double rand) {
return (-0.3333333333333333 + a) * (1.0 + (rand / (3.0 * Math.sqrt(a))));
}
def code(a, rand): return (-0.3333333333333333 + a) * (1.0 + (rand / (3.0 * math.sqrt(a))))
function code(a, rand) return Float64(Float64(-0.3333333333333333 + a) * Float64(1.0 + Float64(rand / Float64(3.0 * sqrt(a))))) end
function tmp = code(a, rand) tmp = (-0.3333333333333333 + a) * (1.0 + (rand / (3.0 * sqrt(a)))); end
code[a_, rand_] := N[(N[(-0.3333333333333333 + a), $MachinePrecision] * N[(1.0 + N[(rand / N[(3.0 * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-0.3333333333333333 + a\right) \cdot \left(1 + \frac{rand}{3 \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
sqrt-lowering-sqrt.f6498.4%
Simplified98.4%
Final simplification98.4%
(FPCore (a rand) :precision binary64 (+ (+ -0.3333333333333333 a) (* (* 0.3333333333333333 rand) (sqrt a))))
double code(double a, double rand) {
return (-0.3333333333333333 + a) + ((0.3333333333333333 * rand) * sqrt(a));
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = ((-0.3333333333333333d0) + a) + ((0.3333333333333333d0 * rand) * sqrt(a))
end function
public static double code(double a, double rand) {
return (-0.3333333333333333 + a) + ((0.3333333333333333 * rand) * Math.sqrt(a));
}
def code(a, rand): return (-0.3333333333333333 + a) + ((0.3333333333333333 * rand) * math.sqrt(a))
function code(a, rand) return Float64(Float64(-0.3333333333333333 + a) + Float64(Float64(0.3333333333333333 * rand) * sqrt(a))) end
function tmp = code(a, rand) tmp = (-0.3333333333333333 + a) + ((0.3333333333333333 * rand) * sqrt(a)); end
code[a_, rand_] := N[(N[(-0.3333333333333333 + a), $MachinePrecision] + N[(N[(0.3333333333333333 * rand), $MachinePrecision] * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-0.3333333333333333 + a\right) + \left(0.3333333333333333 \cdot rand\right) \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 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%
Taylor expanded in a around inf
sqrt-lowering-sqrt.f6498.4%
Simplified98.4%
Final simplification98.4%
(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-*.f6497.7%
Simplified97.7%
Taylor expanded in a around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6497.8%
Simplified97.8%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (- 0.1111111111111111 (* a a))))
(if (<= rand -3.6e+137)
(* t_0 (+ (* a 9.0) -3.0))
(if (<= rand 6.5e+152)
(+ -0.3333333333333333 a)
(* 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 <= -3.6e+137) {
tmp = t_0 * ((a * 9.0) + -3.0);
} else if (rand <= 6.5e+152) {
tmp = -0.3333333333333333 + a;
} 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 <= (-3.6d+137)) then
tmp = t_0 * ((a * 9.0d0) + (-3.0d0))
else if (rand <= 6.5d+152) then
tmp = (-0.3333333333333333d0) + a
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 <= -3.6e+137) {
tmp = t_0 * ((a * 9.0) + -3.0);
} else if (rand <= 6.5e+152) {
tmp = -0.3333333333333333 + a;
} 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 <= -3.6e+137: tmp = t_0 * ((a * 9.0) + -3.0) elif rand <= 6.5e+152: tmp = -0.3333333333333333 + a 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 <= -3.6e+137) tmp = Float64(t_0 * Float64(Float64(a * 9.0) + -3.0)); elseif (rand <= 6.5e+152) tmp = Float64(-0.3333333333333333 + a); 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 <= -3.6e+137) tmp = t_0 * ((a * 9.0) + -3.0); elseif (rand <= 6.5e+152) tmp = -0.3333333333333333 + a; 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, -3.6e+137], N[(t$95$0 * N[(N[(a * 9.0), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 6.5e+152], N[(-0.3333333333333333 + a), $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 -3.6 \cdot 10^{+137}:\\
\;\;\;\;t\_0 \cdot \left(a \cdot 9 + -3\right)\\
\mathbf{elif}\;rand \leq 6.5 \cdot 10^{+152}:\\
\;\;\;\;-0.3333333333333333 + a\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(-3 + a \cdot \left(9 + a \cdot -27\right)\right)\\
\end{array}
\end{array}
if rand < -3.6e137Initial 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.8%
Simplified99.8%
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-eval53.9%
Simplified53.9%
if -3.6e137 < rand < 6.4999999999999997e152Initial 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-+.f6478.9%
Simplified78.9%
if 6.4999999999999997e152 < rand Initial program 99.7%
*-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.5%
Simplified5.5%
flip-+N/A
div-invN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6431.1%
Applied egg-rr31.1%
Taylor expanded in a around 0
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval48.3%
Simplified48.3%
Final simplification71.6%
(FPCore (a rand)
:precision binary64
(let* ((t_0 (- 0.1111111111111111 (* a a))))
(if (<= rand -1.8e+140)
(* t_0 (+ (* a 9.0) -3.0))
(if (<= rand 1.36e+147) (+ -0.3333333333333333 a) (* t_0 -3.0)))))
double code(double a, double rand) {
double t_0 = 0.1111111111111111 - (a * a);
double tmp;
if (rand <= -1.8e+140) {
tmp = t_0 * ((a * 9.0) + -3.0);
} else if (rand <= 1.36e+147) {
tmp = -0.3333333333333333 + a;
} 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 <= (-1.8d+140)) then
tmp = t_0 * ((a * 9.0d0) + (-3.0d0))
else if (rand <= 1.36d+147) then
tmp = (-0.3333333333333333d0) + a
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 <= -1.8e+140) {
tmp = t_0 * ((a * 9.0) + -3.0);
} else if (rand <= 1.36e+147) {
tmp = -0.3333333333333333 + a;
} else {
tmp = t_0 * -3.0;
}
return tmp;
}
def code(a, rand): t_0 = 0.1111111111111111 - (a * a) tmp = 0 if rand <= -1.8e+140: tmp = t_0 * ((a * 9.0) + -3.0) elif rand <= 1.36e+147: tmp = -0.3333333333333333 + a 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 <= -1.8e+140) tmp = Float64(t_0 * Float64(Float64(a * 9.0) + -3.0)); elseif (rand <= 1.36e+147) tmp = Float64(-0.3333333333333333 + a); 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 <= -1.8e+140) tmp = t_0 * ((a * 9.0) + -3.0); elseif (rand <= 1.36e+147) tmp = -0.3333333333333333 + a; 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, -1.8e+140], N[(t$95$0 * N[(N[(a * 9.0), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[rand, 1.36e+147], N[(-0.3333333333333333 + a), $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 -1.8 \cdot 10^{+140}:\\
\;\;\;\;t\_0 \cdot \left(a \cdot 9 + -3\right)\\
\mathbf{elif}\;rand \leq 1.36 \cdot 10^{+147}:\\
\;\;\;\;-0.3333333333333333 + a\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot -3\\
\end{array}
\end{array}
if rand < -1.8e140Initial 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.8%
Simplified99.8%
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-eval53.9%
Simplified53.9%
if -1.8e140 < rand < 1.35999999999999996e147Initial 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-+.f6479.7%
Simplified79.7%
if 1.35999999999999996e147 < rand Initial program 99.7%
*-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.6%
Simplified5.6%
flip-+N/A
div-invN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6429.5%
Applied egg-rr29.5%
Taylor expanded in a around 0
Simplified30.5%
(FPCore (a rand) :precision binary64 (if (<= rand 4.4e+148) (+ -0.3333333333333333 a) (* (- 0.1111111111111111 (* a a)) -3.0)))
double code(double a, double rand) {
double tmp;
if (rand <= 4.4e+148) {
tmp = -0.3333333333333333 + a;
} 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 <= 4.4d+148) then
tmp = (-0.3333333333333333d0) + a
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 <= 4.4e+148) {
tmp = -0.3333333333333333 + a;
} else {
tmp = (0.1111111111111111 - (a * a)) * -3.0;
}
return tmp;
}
def code(a, rand): tmp = 0 if rand <= 4.4e+148: tmp = -0.3333333333333333 + a else: tmp = (0.1111111111111111 - (a * a)) * -3.0 return tmp
function code(a, rand) tmp = 0.0 if (rand <= 4.4e+148) tmp = Float64(-0.3333333333333333 + a); 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 <= 4.4e+148) tmp = -0.3333333333333333 + a; else tmp = (0.1111111111111111 - (a * a)) * -3.0; end tmp_2 = tmp; end
code[a_, rand_] := If[LessEqual[rand, 4.4e+148], N[(-0.3333333333333333 + a), $MachinePrecision], N[(N[(0.1111111111111111 - N[(a * a), $MachinePrecision]), $MachinePrecision] * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;rand \leq 4.4 \cdot 10^{+148}:\\
\;\;\;\;-0.3333333333333333 + a\\
\mathbf{else}:\\
\;\;\;\;\left(0.1111111111111111 - a \cdot a\right) \cdot -3\\
\end{array}
\end{array}
if rand < 4.3999999999999998e148Initial 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-+.f6465.6%
Simplified65.6%
if 4.3999999999999998e148 < rand Initial program 99.7%
*-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.6%
Simplified5.6%
flip-+N/A
div-invN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6429.5%
Applied egg-rr29.5%
Taylor expanded in a around 0
Simplified30.5%
(FPCore (a rand) :precision binary64 (+ -0.3333333333333333 a))
double code(double a, double rand) {
return -0.3333333333333333 + a;
}
real(8) function code(a, rand)
real(8), intent (in) :: a
real(8), intent (in) :: rand
code = (-0.3333333333333333d0) + a
end function
public static double code(double a, double rand) {
return -0.3333333333333333 + a;
}
def code(a, rand): return -0.3333333333333333 + a
function code(a, rand) return Float64(-0.3333333333333333 + a) end
function tmp = code(a, rand) tmp = -0.3333333333333333 + a; end
code[a_, rand_] := N[(-0.3333333333333333 + a), $MachinePrecision]
\begin{array}{l}
\\
-0.3333333333333333 + 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-+.f6458.4%
Simplified58.4%
(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-+.f6458.4%
Simplified58.4%
Taylor expanded in a around inf
Simplified57.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-+.f6458.4%
Simplified58.4%
Taylor expanded in a around 0
Simplified1.6%
herbie shell --seed 2024145
(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))))