
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
(FPCore (x y z t a)
:precision binary64
(if (<= z -1e+31)
(* y (- x))
(if (<= z 0.00036)
(* z (/ (* y x) (sqrt (- (* z z) (* t a)))))
(* (* y x) (/ z (+ z (* -0.5 (* a (/ t z)))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e+31) {
tmp = y * -x;
} else if (z <= 0.00036) {
tmp = z * ((y * x) / sqrt(((z * z) - (t * a))));
} else {
tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z)))));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1d+31)) then
tmp = y * -x
else if (z <= 0.00036d0) then
tmp = z * ((y * x) / sqrt(((z * z) - (t * a))))
else
tmp = (y * x) * (z / (z + ((-0.5d0) * (a * (t / z)))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e+31) {
tmp = y * -x;
} else if (z <= 0.00036) {
tmp = z * ((y * x) / Math.sqrt(((z * z) - (t * a))));
} else {
tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z)))));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1e+31: tmp = y * -x elif z <= 0.00036: tmp = z * ((y * x) / math.sqrt(((z * z) - (t * a)))) else: tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z))))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1e+31) tmp = Float64(y * Float64(-x)); elseif (z <= 0.00036) tmp = Float64(z * Float64(Float64(y * x) / sqrt(Float64(Float64(z * z) - Float64(t * a))))); else tmp = Float64(Float64(y * x) * Float64(z / Float64(z + Float64(-0.5 * Float64(a * Float64(t / z)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1e+31) tmp = y * -x; elseif (z <= 0.00036) tmp = z * ((y * x) / sqrt(((z * z) - (t * a)))); else tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e+31], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 0.00036], N[(z * N[(N[(y * x), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] * N[(z / N[(z + N[(-0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+31}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 0.00036:\\
\;\;\;\;z \cdot \frac{y \cdot x}{\sqrt{z \cdot z - t \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{z + -0.5 \cdot \left(a \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -9.9999999999999996e30Initial program 37.0%
associate-*l*30.8%
associate-*r/35.2%
*-commutative35.2%
associate-/l*40.4%
Simplified40.4%
Taylor expanded in z around -inf 94.4%
mul-1-neg94.4%
distribute-rgt-neg-in94.4%
Simplified94.4%
if -9.9999999999999996e30 < z < 3.60000000000000023e-4Initial program 89.3%
associate-*l/91.0%
Simplified91.0%
if 3.60000000000000023e-4 < z Initial program 32.4%
*-commutative32.4%
associate-/l*33.9%
Simplified33.9%
Taylor expanded in z around inf 68.5%
associate-/r/83.7%
+-commutative83.7%
fma-def83.7%
associate-/l*91.9%
Applied egg-rr91.9%
fma-udef91.9%
div-inv91.9%
clear-num91.9%
Applied egg-rr91.9%
Final simplification92.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* x (/ z (/ (sqrt (- (* z z) (* t a))) y)))))
(if (<= z -6e+51)
(* y (- x))
(if (<= z -3.4e-151)
t_1
(if (<= z 7.2e-168)
(/ z (/ (sqrt (* t (- a))) (* y x)))
(if (<= z 0.00036)
t_1
(* (* y x) (/ z (+ z (* -0.5 (* a (/ t z))))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x * (z / (sqrt(((z * z) - (t * a))) / y));
double tmp;
if (z <= -6e+51) {
tmp = y * -x;
} else if (z <= -3.4e-151) {
tmp = t_1;
} else if (z <= 7.2e-168) {
tmp = z / (sqrt((t * -a)) / (y * x));
} else if (z <= 0.00036) {
tmp = t_1;
} else {
tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z)))));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x * (z / (sqrt(((z * z) - (t * a))) / y))
if (z <= (-6d+51)) then
tmp = y * -x
else if (z <= (-3.4d-151)) then
tmp = t_1
else if (z <= 7.2d-168) then
tmp = z / (sqrt((t * -a)) / (y * x))
else if (z <= 0.00036d0) then
tmp = t_1
else
tmp = (y * x) * (z / (z + ((-0.5d0) * (a * (t / z)))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x * (z / (Math.sqrt(((z * z) - (t * a))) / y));
double tmp;
if (z <= -6e+51) {
tmp = y * -x;
} else if (z <= -3.4e-151) {
tmp = t_1;
} else if (z <= 7.2e-168) {
tmp = z / (Math.sqrt((t * -a)) / (y * x));
} else if (z <= 0.00036) {
tmp = t_1;
} else {
tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z)))));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x * (z / (math.sqrt(((z * z) - (t * a))) / y)) tmp = 0 if z <= -6e+51: tmp = y * -x elif z <= -3.4e-151: tmp = t_1 elif z <= 7.2e-168: tmp = z / (math.sqrt((t * -a)) / (y * x)) elif z <= 0.00036: tmp = t_1 else: tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z))))) return tmp
function code(x, y, z, t, a) t_1 = Float64(x * Float64(z / Float64(sqrt(Float64(Float64(z * z) - Float64(t * a))) / y))) tmp = 0.0 if (z <= -6e+51) tmp = Float64(y * Float64(-x)); elseif (z <= -3.4e-151) tmp = t_1; elseif (z <= 7.2e-168) tmp = Float64(z / Float64(sqrt(Float64(t * Float64(-a))) / Float64(y * x))); elseif (z <= 0.00036) tmp = t_1; else tmp = Float64(Float64(y * x) * Float64(z / Float64(z + Float64(-0.5 * Float64(a * Float64(t / z)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x * (z / (sqrt(((z * z) - (t * a))) / y)); tmp = 0.0; if (z <= -6e+51) tmp = y * -x; elseif (z <= -3.4e-151) tmp = t_1; elseif (z <= 7.2e-168) tmp = z / (sqrt((t * -a)) / (y * x)); elseif (z <= 0.00036) tmp = t_1; else tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(z / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e+51], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -3.4e-151], t$95$1, If[LessEqual[z, 7.2e-168], N[(z / N[(N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision] / N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.00036], t$95$1, N[(N[(y * x), $MachinePrecision] * N[(z / N[(z + N[(-0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z}{\frac{\sqrt{z \cdot z - t \cdot a}}{y}}\\
\mathbf{if}\;z \leq -6 \cdot 10^{+51}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-151}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-168}:\\
\;\;\;\;\frac{z}{\frac{\sqrt{t \cdot \left(-a\right)}}{y \cdot x}}\\
\mathbf{elif}\;z \leq 0.00036:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{z + -0.5 \cdot \left(a \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -6e51Initial program 33.0%
associate-*l*26.4%
associate-*r/31.1%
*-commutative31.1%
associate-/l*36.6%
Simplified36.6%
Taylor expanded in z around -inf 94.0%
mul-1-neg94.0%
distribute-rgt-neg-in94.0%
Simplified94.0%
if -6e51 < z < -3.4000000000000003e-151 or 7.1999999999999998e-168 < z < 3.60000000000000023e-4Initial program 92.3%
associate-*l*89.1%
associate-*r/90.3%
*-commutative90.3%
associate-/l*89.1%
Simplified89.1%
if -3.4000000000000003e-151 < z < 7.1999999999999998e-168Initial program 84.8%
*-commutative84.8%
associate-/l*87.6%
Simplified87.6%
Taylor expanded in z around 0 87.6%
mul-1-neg76.8%
distribute-rgt-neg-out76.8%
Simplified87.6%
if 3.60000000000000023e-4 < z Initial program 32.4%
*-commutative32.4%
associate-/l*33.9%
Simplified33.9%
Taylor expanded in z around inf 68.5%
associate-/r/83.7%
+-commutative83.7%
fma-def83.7%
associate-/l*91.9%
Applied egg-rr91.9%
fma-udef91.9%
div-inv91.9%
clear-num91.9%
Applied egg-rr91.9%
Final simplification90.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* x (/ z (/ (sqrt (* t (- a))) y)))))
(if (<= z -3.6e-44)
(* y (- x))
(if (<= z -2.55e-69)
t_1
(if (<= z -5.2e-199)
(/ (* z (* y x)) (- (* 0.5 (/ (* t a) z)) z))
(if (<= z 2.1e-88)
t_1
(* (* y x) (/ z (+ z (* -0.5 (* a (/ t z))))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x * (z / (sqrt((t * -a)) / y));
double tmp;
if (z <= -3.6e-44) {
tmp = y * -x;
} else if (z <= -2.55e-69) {
tmp = t_1;
} else if (z <= -5.2e-199) {
tmp = (z * (y * x)) / ((0.5 * ((t * a) / z)) - z);
} else if (z <= 2.1e-88) {
tmp = t_1;
} else {
tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z)))));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x * (z / (sqrt((t * -a)) / y))
if (z <= (-3.6d-44)) then
tmp = y * -x
else if (z <= (-2.55d-69)) then
tmp = t_1
else if (z <= (-5.2d-199)) then
tmp = (z * (y * x)) / ((0.5d0 * ((t * a) / z)) - z)
else if (z <= 2.1d-88) then
tmp = t_1
else
tmp = (y * x) * (z / (z + ((-0.5d0) * (a * (t / z)))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x * (z / (Math.sqrt((t * -a)) / y));
double tmp;
if (z <= -3.6e-44) {
tmp = y * -x;
} else if (z <= -2.55e-69) {
tmp = t_1;
} else if (z <= -5.2e-199) {
tmp = (z * (y * x)) / ((0.5 * ((t * a) / z)) - z);
} else if (z <= 2.1e-88) {
tmp = t_1;
} else {
tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z)))));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x * (z / (math.sqrt((t * -a)) / y)) tmp = 0 if z <= -3.6e-44: tmp = y * -x elif z <= -2.55e-69: tmp = t_1 elif z <= -5.2e-199: tmp = (z * (y * x)) / ((0.5 * ((t * a) / z)) - z) elif z <= 2.1e-88: tmp = t_1 else: tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z))))) return tmp
function code(x, y, z, t, a) t_1 = Float64(x * Float64(z / Float64(sqrt(Float64(t * Float64(-a))) / y))) tmp = 0.0 if (z <= -3.6e-44) tmp = Float64(y * Float64(-x)); elseif (z <= -2.55e-69) tmp = t_1; elseif (z <= -5.2e-199) tmp = Float64(Float64(z * Float64(y * x)) / Float64(Float64(0.5 * Float64(Float64(t * a) / z)) - z)); elseif (z <= 2.1e-88) tmp = t_1; else tmp = Float64(Float64(y * x) * Float64(z / Float64(z + Float64(-0.5 * Float64(a * Float64(t / z)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x * (z / (sqrt((t * -a)) / y)); tmp = 0.0; if (z <= -3.6e-44) tmp = y * -x; elseif (z <= -2.55e-69) tmp = t_1; elseif (z <= -5.2e-199) tmp = (z * (y * x)) / ((0.5 * ((t * a) / z)) - z); elseif (z <= 2.1e-88) tmp = t_1; else tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(z / N[(N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e-44], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -2.55e-69], t$95$1, If[LessEqual[z, -5.2e-199], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e-88], t$95$1, N[(N[(y * x), $MachinePrecision] * N[(z / N[(z + N[(-0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z}{\frac{\sqrt{t \cdot \left(-a\right)}}{y}}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-44}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -2.55 \cdot 10^{-69}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-199}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{0.5 \cdot \frac{t \cdot a}{z} - z}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-88}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{z + -0.5 \cdot \left(a \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -3.5999999999999999e-44Initial program 46.1%
associate-*l*40.9%
associate-*r/45.8%
*-commutative45.8%
associate-/l*50.2%
Simplified50.2%
Taylor expanded in z around -inf 91.8%
mul-1-neg91.8%
distribute-rgt-neg-in91.8%
Simplified91.8%
if -3.5999999999999999e-44 < z < -2.54999999999999993e-69 or -5.2000000000000001e-199 < z < 2.1e-88Initial program 82.1%
associate-*l*74.8%
associate-*r/78.3%
*-commutative78.3%
associate-/l*79.0%
Simplified79.0%
Taylor expanded in z around 0 75.1%
mul-1-neg75.1%
distribute-rgt-neg-out75.1%
Simplified75.1%
if -2.54999999999999993e-69 < z < -5.2000000000000001e-199Initial program 99.7%
Taylor expanded in z around -inf 73.2%
neg-mul-173.2%
unsub-neg73.2%
Simplified73.2%
if 2.1e-88 < z Initial program 44.6%
*-commutative44.6%
associate-/l*45.0%
Simplified45.0%
Taylor expanded in z around inf 71.2%
associate-/r/84.6%
+-commutative84.6%
fma-def84.6%
associate-/l*91.3%
Applied egg-rr91.3%
fma-udef91.3%
div-inv91.3%
clear-num91.3%
Applied egg-rr91.3%
Final simplification85.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ (* y x) (sqrt (* t (- a)))))))
(if (<= z -3.2e-44)
(* y (- x))
(if (<= z -1.8e-65)
t_1
(if (<= z -1.1e-105)
(/ (* z (* y x)) (- (* 0.5 (/ (* t a) z)) z))
(if (<= z 4.1e-87)
t_1
(* (* y x) (/ z (+ z (* -0.5 (* a (/ t z))))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * ((y * x) / sqrt((t * -a)));
double tmp;
if (z <= -3.2e-44) {
tmp = y * -x;
} else if (z <= -1.8e-65) {
tmp = t_1;
} else if (z <= -1.1e-105) {
tmp = (z * (y * x)) / ((0.5 * ((t * a) / z)) - z);
} else if (z <= 4.1e-87) {
tmp = t_1;
} else {
tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z)))));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = z * ((y * x) / sqrt((t * -a)))
if (z <= (-3.2d-44)) then
tmp = y * -x
else if (z <= (-1.8d-65)) then
tmp = t_1
else if (z <= (-1.1d-105)) then
tmp = (z * (y * x)) / ((0.5d0 * ((t * a) / z)) - z)
else if (z <= 4.1d-87) then
tmp = t_1
else
tmp = (y * x) * (z / (z + ((-0.5d0) * (a * (t / z)))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = z * ((y * x) / Math.sqrt((t * -a)));
double tmp;
if (z <= -3.2e-44) {
tmp = y * -x;
} else if (z <= -1.8e-65) {
tmp = t_1;
} else if (z <= -1.1e-105) {
tmp = (z * (y * x)) / ((0.5 * ((t * a) / z)) - z);
} else if (z <= 4.1e-87) {
tmp = t_1;
} else {
tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z)))));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * ((y * x) / math.sqrt((t * -a))) tmp = 0 if z <= -3.2e-44: tmp = y * -x elif z <= -1.8e-65: tmp = t_1 elif z <= -1.1e-105: tmp = (z * (y * x)) / ((0.5 * ((t * a) / z)) - z) elif z <= 4.1e-87: tmp = t_1 else: tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z))))) return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(Float64(y * x) / sqrt(Float64(t * Float64(-a))))) tmp = 0.0 if (z <= -3.2e-44) tmp = Float64(y * Float64(-x)); elseif (z <= -1.8e-65) tmp = t_1; elseif (z <= -1.1e-105) tmp = Float64(Float64(z * Float64(y * x)) / Float64(Float64(0.5 * Float64(Float64(t * a) / z)) - z)); elseif (z <= 4.1e-87) tmp = t_1; else tmp = Float64(Float64(y * x) * Float64(z / Float64(z + Float64(-0.5 * Float64(a * Float64(t / z)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * ((y * x) / sqrt((t * -a))); tmp = 0.0; if (z <= -3.2e-44) tmp = y * -x; elseif (z <= -1.8e-65) tmp = t_1; elseif (z <= -1.1e-105) tmp = (z * (y * x)) / ((0.5 * ((t * a) / z)) - z); elseif (z <= 4.1e-87) tmp = t_1; else tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(N[(y * x), $MachinePrecision] / N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e-44], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -1.8e-65], t$95$1, If[LessEqual[z, -1.1e-105], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.1e-87], t$95$1, N[(N[(y * x), $MachinePrecision] * N[(z / N[(z + N[(-0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y \cdot x}{\sqrt{t \cdot \left(-a\right)}}\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{-44}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-105}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{0.5 \cdot \frac{t \cdot a}{z} - z}\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{-87}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{z + -0.5 \cdot \left(a \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -3.19999999999999995e-44Initial program 46.1%
associate-*l*40.9%
associate-*r/45.8%
*-commutative45.8%
associate-/l*50.2%
Simplified50.2%
Taylor expanded in z around -inf 91.8%
mul-1-neg91.8%
distribute-rgt-neg-in91.8%
Simplified91.8%
if -3.19999999999999995e-44 < z < -1.7999999999999999e-65 or -1.10000000000000002e-105 < z < 4.10000000000000033e-87Initial program 85.2%
associate-*l/88.0%
Simplified88.0%
Taylor expanded in z around 0 82.2%
mul-1-neg73.3%
distribute-rgt-neg-out73.3%
Simplified82.2%
if -1.7999999999999999e-65 < z < -1.10000000000000002e-105Initial program 99.7%
Taylor expanded in z around -inf 81.6%
neg-mul-181.6%
unsub-neg81.6%
Simplified81.6%
if 4.10000000000000033e-87 < z Initial program 44.6%
*-commutative44.6%
associate-/l*45.0%
Simplified45.0%
Taylor expanded in z around inf 71.2%
associate-/r/84.6%
+-commutative84.6%
fma-def84.6%
associate-/l*91.3%
Applied egg-rr91.3%
fma-udef91.3%
div-inv91.3%
clear-num91.3%
Applied egg-rr91.3%
Final simplification88.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ z (/ (sqrt (* t (- a))) (* y x)))))
(if (<= z -2.9e-43)
(* y (- x))
(if (<= z -2.2e-66)
t_1
(if (<= z -1.04e-106)
(/ (* z (* y x)) (- (* 0.5 (/ (* t a) z)) z))
(if (<= z 6.5e-88)
t_1
(* (* y x) (/ z (+ z (* -0.5 (* a (/ t z))))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z / (sqrt((t * -a)) / (y * x));
double tmp;
if (z <= -2.9e-43) {
tmp = y * -x;
} else if (z <= -2.2e-66) {
tmp = t_1;
} else if (z <= -1.04e-106) {
tmp = (z * (y * x)) / ((0.5 * ((t * a) / z)) - z);
} else if (z <= 6.5e-88) {
tmp = t_1;
} else {
tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z)))));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = z / (sqrt((t * -a)) / (y * x))
if (z <= (-2.9d-43)) then
tmp = y * -x
else if (z <= (-2.2d-66)) then
tmp = t_1
else if (z <= (-1.04d-106)) then
tmp = (z * (y * x)) / ((0.5d0 * ((t * a) / z)) - z)
else if (z <= 6.5d-88) then
tmp = t_1
else
tmp = (y * x) * (z / (z + ((-0.5d0) * (a * (t / z)))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = z / (Math.sqrt((t * -a)) / (y * x));
double tmp;
if (z <= -2.9e-43) {
tmp = y * -x;
} else if (z <= -2.2e-66) {
tmp = t_1;
} else if (z <= -1.04e-106) {
tmp = (z * (y * x)) / ((0.5 * ((t * a) / z)) - z);
} else if (z <= 6.5e-88) {
tmp = t_1;
} else {
tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z)))));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z / (math.sqrt((t * -a)) / (y * x)) tmp = 0 if z <= -2.9e-43: tmp = y * -x elif z <= -2.2e-66: tmp = t_1 elif z <= -1.04e-106: tmp = (z * (y * x)) / ((0.5 * ((t * a) / z)) - z) elif z <= 6.5e-88: tmp = t_1 else: tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z))))) return tmp
function code(x, y, z, t, a) t_1 = Float64(z / Float64(sqrt(Float64(t * Float64(-a))) / Float64(y * x))) tmp = 0.0 if (z <= -2.9e-43) tmp = Float64(y * Float64(-x)); elseif (z <= -2.2e-66) tmp = t_1; elseif (z <= -1.04e-106) tmp = Float64(Float64(z * Float64(y * x)) / Float64(Float64(0.5 * Float64(Float64(t * a) / z)) - z)); elseif (z <= 6.5e-88) tmp = t_1; else tmp = Float64(Float64(y * x) * Float64(z / Float64(z + Float64(-0.5 * Float64(a * Float64(t / z)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z / (sqrt((t * -a)) / (y * x)); tmp = 0.0; if (z <= -2.9e-43) tmp = y * -x; elseif (z <= -2.2e-66) tmp = t_1; elseif (z <= -1.04e-106) tmp = (z * (y * x)) / ((0.5 * ((t * a) / z)) - z); elseif (z <= 6.5e-88) tmp = t_1; else tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z / N[(N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision] / N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e-43], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -2.2e-66], t$95$1, If[LessEqual[z, -1.04e-106], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-88], t$95$1, N[(N[(y * x), $MachinePrecision] * N[(z / N[(z + N[(-0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{\frac{\sqrt{t \cdot \left(-a\right)}}{y \cdot x}}\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{-43}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.04 \cdot 10^{-106}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{0.5 \cdot \frac{t \cdot a}{z} - z}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-88}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{z + -0.5 \cdot \left(a \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -2.9000000000000001e-43Initial program 46.1%
associate-*l*40.9%
associate-*r/45.8%
*-commutative45.8%
associate-/l*50.2%
Simplified50.2%
Taylor expanded in z around -inf 91.8%
mul-1-neg91.8%
distribute-rgt-neg-in91.8%
Simplified91.8%
if -2.9000000000000001e-43 < z < -2.2000000000000001e-66 or -1.04e-106 < z < 6.50000000000000006e-88Initial program 85.2%
*-commutative85.2%
associate-/l*88.0%
Simplified88.0%
Taylor expanded in z around 0 82.2%
mul-1-neg73.3%
distribute-rgt-neg-out73.3%
Simplified82.2%
if -2.2000000000000001e-66 < z < -1.04e-106Initial program 99.7%
Taylor expanded in z around -inf 81.6%
neg-mul-181.6%
unsub-neg81.6%
Simplified81.6%
if 6.50000000000000006e-88 < z Initial program 44.6%
*-commutative44.6%
associate-/l*45.0%
Simplified45.0%
Taylor expanded in z around inf 71.2%
associate-/r/84.6%
+-commutative84.6%
fma-def84.6%
associate-/l*91.3%
Applied egg-rr91.3%
fma-udef91.3%
div-inv91.3%
clear-num91.3%
Applied egg-rr91.3%
Final simplification88.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.9e-199)
(* y (- x))
(if (<= z 1.32e-33)
(* x (/ z (/ (+ z (* -0.5 (/ (* t a) z))) y)))
(* y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e-199) {
tmp = y * -x;
} else if (z <= 1.32e-33) {
tmp = x * (z / ((z + (-0.5 * ((t * a) / z))) / y));
} else {
tmp = y * x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.9d-199)) then
tmp = y * -x
else if (z <= 1.32d-33) then
tmp = x * (z / ((z + ((-0.5d0) * ((t * a) / z))) / y))
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e-199) {
tmp = y * -x;
} else if (z <= 1.32e-33) {
tmp = x * (z / ((z + (-0.5 * ((t * a) / z))) / y));
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.9e-199: tmp = y * -x elif z <= 1.32e-33: tmp = x * (z / ((z + (-0.5 * ((t * a) / z))) / y)) else: tmp = y * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.9e-199) tmp = Float64(y * Float64(-x)); elseif (z <= 1.32e-33) tmp = Float64(x * Float64(z / Float64(Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z))) / y))); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.9e-199) tmp = y * -x; elseif (z <= 1.32e-33) tmp = x * (z / ((z + (-0.5 * ((t * a) / z))) / y)); else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.9e-199], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.32e-33], N[(x * N[(z / N[(N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-199}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{-33}:\\
\;\;\;\;x \cdot \frac{z}{\frac{z + -0.5 \cdot \frac{t \cdot a}{z}}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2.9e-199Initial program 61.4%
associate-*l*56.0%
associate-*r/57.1%
*-commutative57.1%
associate-/l*58.5%
Simplified58.5%
Taylor expanded in z around -inf 80.3%
mul-1-neg80.3%
distribute-rgt-neg-in80.3%
Simplified80.3%
if -2.9e-199 < z < 1.31999999999999993e-33Initial program 83.6%
associate-*l*77.0%
associate-*r/81.9%
*-commutative81.9%
associate-/l*82.5%
Simplified82.5%
Taylor expanded in z around inf 64.5%
if 1.31999999999999993e-33 < z Initial program 39.0%
associate-*l*37.6%
associate-*r/40.3%
*-commutative40.3%
associate-/l*38.3%
Simplified38.3%
Taylor expanded in z around inf 91.0%
Final simplification79.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.6e-199) (* y (- x)) (if (<= z 2.9e-154) (* -2.0 (/ (/ (* (* z y) (* z x)) a) t)) (* y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.6e-199) {
tmp = y * -x;
} else if (z <= 2.9e-154) {
tmp = -2.0 * ((((z * y) * (z * x)) / a) / t);
} else {
tmp = y * x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.6d-199)) then
tmp = y * -x
else if (z <= 2.9d-154) then
tmp = (-2.0d0) * ((((z * y) * (z * x)) / a) / t)
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.6e-199) {
tmp = y * -x;
} else if (z <= 2.9e-154) {
tmp = -2.0 * ((((z * y) * (z * x)) / a) / t);
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.6e-199: tmp = y * -x elif z <= 2.9e-154: tmp = -2.0 * ((((z * y) * (z * x)) / a) / t) else: tmp = y * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.6e-199) tmp = Float64(y * Float64(-x)); elseif (z <= 2.9e-154) tmp = Float64(-2.0 * Float64(Float64(Float64(Float64(z * y) * Float64(z * x)) / a) / t)); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.6e-199) tmp = y * -x; elseif (z <= 2.9e-154) tmp = -2.0 * ((((z * y) * (z * x)) / a) / t); else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.6e-199], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.9e-154], N[(-2.0 * N[(N[(N[(N[(z * y), $MachinePrecision] * N[(z * x), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-199}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-154}:\\
\;\;\;\;-2 \cdot \frac{\frac{\left(z \cdot y\right) \cdot \left(z \cdot x\right)}{a}}{t}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2.6000000000000001e-199Initial program 61.4%
associate-*l*56.0%
associate-*r/57.1%
*-commutative57.1%
associate-/l*58.5%
Simplified58.5%
Taylor expanded in z around -inf 80.3%
mul-1-neg80.3%
distribute-rgt-neg-in80.3%
Simplified80.3%
if -2.6000000000000001e-199 < z < 2.9e-154Initial program 84.5%
*-commutative84.5%
associate-/l*87.3%
Simplified87.3%
Taylor expanded in z around inf 64.7%
associate-/r/66.1%
+-commutative66.1%
fma-def66.1%
associate-/l*66.9%
Applied egg-rr66.9%
Taylor expanded in z around 0 64.3%
times-frac64.3%
unpow264.3%
associate-*r*64.6%
associate-*r/64.6%
associate-*l/64.8%
associate-*r*64.9%
*-commutative64.9%
Simplified64.9%
if 2.9e-154 < z Initial program 48.0%
associate-*l*46.4%
associate-*r/51.0%
*-commutative51.0%
associate-/l*50.2%
Simplified50.2%
Taylor expanded in z around inf 82.5%
Final simplification78.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.2e-199) (* y (- x)) (* (* y x) (/ z (+ z (* -0.5 (* a (/ t z))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.2e-199) {
tmp = y * -x;
} else {
tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z)))));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-7.2d-199)) then
tmp = y * -x
else
tmp = (y * x) * (z / (z + ((-0.5d0) * (a * (t / z)))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.2e-199) {
tmp = y * -x;
} else {
tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z)))));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.2e-199: tmp = y * -x else: tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z))))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.2e-199) tmp = Float64(y * Float64(-x)); else tmp = Float64(Float64(y * x) * Float64(z / Float64(z + Float64(-0.5 * Float64(a * Float64(t / z)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.2e-199) tmp = y * -x; else tmp = (y * x) * (z / (z + (-0.5 * (a * (t / z))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.2e-199], N[(y * (-x)), $MachinePrecision], N[(N[(y * x), $MachinePrecision] * N[(z / N[(z + N[(-0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-199}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{z + -0.5 \cdot \left(a \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -7.2000000000000003e-199Initial program 61.4%
associate-*l*56.0%
associate-*r/57.1%
*-commutative57.1%
associate-/l*58.5%
Simplified58.5%
Taylor expanded in z around -inf 80.3%
mul-1-neg80.3%
distribute-rgt-neg-in80.3%
Simplified80.3%
if -7.2000000000000003e-199 < z Initial program 59.0%
*-commutative59.0%
associate-/l*61.4%
Simplified61.4%
Taylor expanded in z around inf 67.2%
associate-/r/75.8%
+-commutative75.8%
fma-def75.8%
associate-/l*80.1%
Applied egg-rr80.1%
fma-udef80.1%
div-inv80.1%
clear-num80.1%
Applied egg-rr80.1%
Final simplification80.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.55e-199) (* y (- x)) (if (<= z 4.4e-83) (/ (* y (* z x)) z) (* y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e-199) {
tmp = y * -x;
} else if (z <= 4.4e-83) {
tmp = (y * (z * x)) / z;
} else {
tmp = y * x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.55d-199)) then
tmp = y * -x
else if (z <= 4.4d-83) then
tmp = (y * (z * x)) / z
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e-199) {
tmp = y * -x;
} else if (z <= 4.4e-83) {
tmp = (y * (z * x)) / z;
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.55e-199: tmp = y * -x elif z <= 4.4e-83: tmp = (y * (z * x)) / z else: tmp = y * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.55e-199) tmp = Float64(y * Float64(-x)); elseif (z <= 4.4e-83) tmp = Float64(Float64(y * Float64(z * x)) / z); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.55e-199) tmp = y * -x; elseif (z <= 4.4e-83) tmp = (y * (z * x)) / z; else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.55e-199], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 4.4e-83], N[(N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-199}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-83}:\\
\;\;\;\;\frac{y \cdot \left(z \cdot x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.55000000000000006e-199Initial program 61.4%
associate-*l*56.0%
associate-*r/57.1%
*-commutative57.1%
associate-/l*58.5%
Simplified58.5%
Taylor expanded in z around -inf 80.3%
mul-1-neg80.3%
distribute-rgt-neg-in80.3%
Simplified80.3%
if -1.55000000000000006e-199 < z < 4.40000000000000015e-83Initial program 81.7%
Taylor expanded in z around inf 48.8%
Taylor expanded in x around 0 54.1%
if 4.40000000000000015e-83 < z Initial program 43.9%
associate-*l*42.1%
associate-*r/44.6%
*-commutative44.6%
associate-/l*42.6%
Simplified42.6%
Taylor expanded in z around inf 89.6%
Final simplification77.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.45e-257) (* y (- x)) (if (<= z 8.5e-86) (/ (* x (* z y)) z) (* y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.45e-257) {
tmp = y * -x;
} else if (z <= 8.5e-86) {
tmp = (x * (z * y)) / z;
} else {
tmp = y * x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.45d-257)) then
tmp = y * -x
else if (z <= 8.5d-86) then
tmp = (x * (z * y)) / z
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.45e-257) {
tmp = y * -x;
} else if (z <= 8.5e-86) {
tmp = (x * (z * y)) / z;
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.45e-257: tmp = y * -x elif z <= 8.5e-86: tmp = (x * (z * y)) / z else: tmp = y * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.45e-257) tmp = Float64(y * Float64(-x)); elseif (z <= 8.5e-86) tmp = Float64(Float64(x * Float64(z * y)) / z); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.45e-257) tmp = y * -x; elseif (z <= 8.5e-86) tmp = (x * (z * y)) / z; else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.45e-257], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 8.5e-86], N[(N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{-257}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-86}:\\
\;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2.45000000000000006e-257Initial program 62.8%
associate-*l*56.2%
associate-*r/57.2%
*-commutative57.2%
associate-/l*58.5%
Simplified58.5%
Taylor expanded in z around -inf 77.5%
mul-1-neg77.5%
distribute-rgt-neg-in77.5%
Simplified77.5%
if -2.45000000000000006e-257 < z < 8.499999999999999e-86Initial program 81.1%
Taylor expanded in z around inf 51.3%
Taylor expanded in x around 0 55.4%
associate-*r*57.3%
*-commutative57.3%
Simplified57.3%
if 8.499999999999999e-86 < z Initial program 43.9%
associate-*l*42.1%
associate-*r/44.6%
*-commutative44.6%
associate-/l*42.6%
Simplified42.6%
Taylor expanded in z around inf 89.6%
Final simplification77.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -2e-310) (* y (- x)) (* y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-310) {
tmp = y * -x;
} else {
tmp = y * x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2d-310)) then
tmp = y * -x
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-310) {
tmp = y * -x;
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2e-310: tmp = y * -x else: tmp = y * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e-310) tmp = Float64(y * Float64(-x)); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2e-310) tmp = y * -x; else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e-310], N[(y * (-x)), $MachinePrecision], N[(y * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-310}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.999999999999994e-310Initial program 65.6%
associate-*l*58.7%
associate-*r/60.2%
*-commutative60.2%
associate-/l*60.6%
Simplified60.6%
Taylor expanded in z around -inf 68.0%
mul-1-neg68.0%
distribute-rgt-neg-in68.0%
Simplified68.0%
if -1.999999999999994e-310 < z Initial program 53.5%
associate-*l*51.9%
associate-*r/55.7%
*-commutative55.7%
associate-/l*55.4%
Simplified55.4%
Taylor expanded in z around inf 75.2%
Final simplification71.3%
(FPCore (x y z t a) :precision binary64 (* y x))
double code(double x, double y, double z, double t, double a) {
return y * x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = y * x
end function
public static double code(double x, double y, double z, double t, double a) {
return y * x;
}
def code(x, y, z, t, a): return y * x
function code(x, y, z, t, a) return Float64(y * x) end
function tmp = code(x, y, z, t, a) tmp = y * x; end
code[x_, y_, z_, t_, a_] := N[(y * x), $MachinePrecision]
\begin{array}{l}
\\
y \cdot x
\end{array}
Initial program 60.0%
associate-*l*55.6%
associate-*r/58.1%
*-commutative58.1%
associate-/l*58.2%
Simplified58.2%
Taylor expanded in z around inf 41.8%
Final simplification41.8%
(FPCore (x y z t a)
:precision binary64
(if (< z -3.1921305903852764e+46)
(- (* y x))
(if (< z 5.976268120920894e+90)
(/ (* x z) (/ (sqrt (- (* z z) (* a t))) y))
(* y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z < -3.1921305903852764e+46) {
tmp = -(y * x);
} else if (z < 5.976268120920894e+90) {
tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y);
} else {
tmp = y * x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z < (-3.1921305903852764d+46)) then
tmp = -(y * x)
else if (z < 5.976268120920894d+90) then
tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y)
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z < -3.1921305903852764e+46) {
tmp = -(y * x);
} else if (z < 5.976268120920894e+90) {
tmp = (x * z) / (Math.sqrt(((z * z) - (a * t))) / y);
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z < -3.1921305903852764e+46: tmp = -(y * x) elif z < 5.976268120920894e+90: tmp = (x * z) / (math.sqrt(((z * z) - (a * t))) / y) else: tmp = y * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z < -3.1921305903852764e+46) tmp = Float64(-Float64(y * x)); elseif (z < 5.976268120920894e+90) tmp = Float64(Float64(x * z) / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / y)); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z < -3.1921305903852764e+46) tmp = -(y * x); elseif (z < 5.976268120920894e+90) tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y); else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Less[z, -3.1921305903852764e+46], (-N[(y * x), $MachinePrecision]), If[Less[z, 5.976268120920894e+90], N[(N[(x * z), $MachinePrecision] / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z < -3.1921305903852764 \cdot 10^{+46}:\\
\;\;\;\;-y \cdot x\\
\mathbf{elif}\;z < 5.976268120920894 \cdot 10^{+90}:\\
\;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
herbie shell --seed 2023274
(FPCore (x y z t a)
:name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< z -3.1921305903852764e+46) (- (* y x)) (if (< z 5.976268120920894e+90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))
(/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))