
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ y z) (/ t (- 1.0 z)))))
(if (<= t_1 (- INFINITY))
(* y (/ x z))
(if (or (<= t_1 -1e-166) (not (<= t_1 5e-306)))
(* t_1 x)
(* (/ x z) (+ y t))))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * (x / z);
} else if ((t_1 <= -1e-166) || !(t_1 <= 5e-306)) {
tmp = t_1 * x;
} else {
tmp = (x / z) * (y + t);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = y * (x / z);
} else if ((t_1 <= -1e-166) || !(t_1 <= 5e-306)) {
tmp = t_1 * x;
} else {
tmp = (x / z) * (y + t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) - (t / (1.0 - z)) tmp = 0 if t_1 <= -math.inf: tmp = y * (x / z) elif (t_1 <= -1e-166) or not (t_1 <= 5e-306): tmp = t_1 * x else: tmp = (x / z) * (y + t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(x / z)); elseif ((t_1 <= -1e-166) || !(t_1 <= 5e-306)) tmp = Float64(t_1 * x); else tmp = Float64(Float64(x / z) * Float64(y + t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) - (t / (1.0 - z)); tmp = 0.0; if (t_1 <= -Inf) tmp = y * (x / z); elseif ((t_1 <= -1e-166) || ~((t_1 <= 5e-306))) tmp = t_1 * x; else tmp = (x / z) * (y + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, -1e-166], N[Not[LessEqual[t$95$1, 5e-306]], $MachinePrecision]], N[(t$95$1 * x), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y + t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{-166} \lor \neg \left(t_1 \leq 5 \cdot 10^{-306}\right):\\
\;\;\;\;t_1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(y + t\right)\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < -inf.0Initial program 66.8%
frac-2neg66.8%
div-inv66.8%
fma-neg66.8%
distribute-neg-frac66.8%
Applied egg-rr66.8%
fma-udef66.8%
+-commutative66.8%
distribute-lft-neg-out66.8%
unsub-neg66.8%
neg-mul-166.8%
*-commutative66.8%
associate-*r/66.8%
metadata-eval66.8%
associate-/r*66.8%
neg-mul-166.8%
associate-*r/66.8%
*-rgt-identity66.8%
neg-sub066.8%
associate--r-66.8%
metadata-eval66.8%
neg-mul-166.8%
associate-/r*66.8%
metadata-eval66.8%
Simplified66.8%
Taylor expanded in t around 0 99.8%
*-commutative99.8%
associate-*l/99.9%
Simplified99.9%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < -1.00000000000000004e-166 or 4.99999999999999998e-306 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) Initial program 98.0%
if -1.00000000000000004e-166 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < 4.99999999999999998e-306Initial program 70.9%
Taylor expanded in z around inf 99.8%
*-commutative99.8%
associate-/l*65.3%
associate-/r/99.9%
cancel-sign-sub-inv99.9%
metadata-eval99.9%
*-lft-identity99.9%
Simplified99.9%
Final simplification98.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t (+ z -1.0)))))
(if (<= t -4.2e+185)
t_1
(if (<= t -2.95e+79)
(* x (- (/ y z) t))
(if (<= t 310000000.0) (/ (* y x) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / (z + -1.0));
double tmp;
if (t <= -4.2e+185) {
tmp = t_1;
} else if (t <= -2.95e+79) {
tmp = x * ((y / z) - t);
} else if (t <= 310000000.0) {
tmp = (y * x) / z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t / (z + (-1.0d0)))
if (t <= (-4.2d+185)) then
tmp = t_1
else if (t <= (-2.95d+79)) then
tmp = x * ((y / z) - t)
else if (t <= 310000000.0d0) then
tmp = (y * x) / z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t / (z + -1.0));
double tmp;
if (t <= -4.2e+185) {
tmp = t_1;
} else if (t <= -2.95e+79) {
tmp = x * ((y / z) - t);
} else if (t <= 310000000.0) {
tmp = (y * x) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / (z + -1.0)) tmp = 0 if t <= -4.2e+185: tmp = t_1 elif t <= -2.95e+79: tmp = x * ((y / z) - t) elif t <= 310000000.0: tmp = (y * x) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / Float64(z + -1.0))) tmp = 0.0 if (t <= -4.2e+185) tmp = t_1; elseif (t <= -2.95e+79) tmp = Float64(x * Float64(Float64(y / z) - t)); elseif (t <= 310000000.0) tmp = Float64(Float64(y * x) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / (z + -1.0)); tmp = 0.0; if (t <= -4.2e+185) tmp = t_1; elseif (t <= -2.95e+79) tmp = x * ((y / z) - t); elseif (t <= 310000000.0) tmp = (y * x) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.2e+185], t$95$1, If[LessEqual[t, -2.95e+79], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 310000000.0], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z + -1}\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{+185}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.95 \cdot 10^{+79}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{elif}\;t \leq 310000000:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.2e185 or 3.1e8 < t Initial program 94.7%
Taylor expanded in y around 0 71.4%
associate-*r/71.4%
associate-*r*71.4%
neg-mul-171.4%
associate-*l/80.4%
*-commutative80.4%
neg-mul-180.4%
*-commutative80.4%
associate-*r/80.4%
metadata-eval80.4%
associate-/r*80.4%
neg-mul-180.4%
associate-*r/80.4%
*-rgt-identity80.4%
neg-sub080.4%
associate--r-80.4%
metadata-eval80.4%
Simplified80.4%
if -4.2e185 < t < -2.95e79Initial program 92.7%
Taylor expanded in z around 0 81.1%
associate-*l/77.3%
associate-*r*77.3%
neg-mul-177.3%
distribute-rgt-out77.3%
unsub-neg77.3%
Simplified77.3%
if -2.95e79 < t < 3.1e8Initial program 92.8%
Taylor expanded in y around inf 82.3%
Final simplification81.2%
(FPCore (x y z t)
:precision binary64
(if (<= t -5.1e+194)
(- (* t x))
(if (<= t 4.2e-156)
(* (/ y z) x)
(if (<= t 1.9e+211) (* y (/ x z)) (* x (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.1e+194) {
tmp = -(t * x);
} else if (t <= 4.2e-156) {
tmp = (y / z) * x;
} else if (t <= 1.9e+211) {
tmp = y * (x / z);
} else {
tmp = x * (t / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5.1d+194)) then
tmp = -(t * x)
else if (t <= 4.2d-156) then
tmp = (y / z) * x
else if (t <= 1.9d+211) then
tmp = y * (x / z)
else
tmp = x * (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.1e+194) {
tmp = -(t * x);
} else if (t <= 4.2e-156) {
tmp = (y / z) * x;
} else if (t <= 1.9e+211) {
tmp = y * (x / z);
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5.1e+194: tmp = -(t * x) elif t <= 4.2e-156: tmp = (y / z) * x elif t <= 1.9e+211: tmp = y * (x / z) else: tmp = x * (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5.1e+194) tmp = Float64(-Float64(t * x)); elseif (t <= 4.2e-156) tmp = Float64(Float64(y / z) * x); elseif (t <= 1.9e+211) tmp = Float64(y * Float64(x / z)); else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -5.1e+194) tmp = -(t * x); elseif (t <= 4.2e-156) tmp = (y / z) * x; elseif (t <= 1.9e+211) tmp = y * (x / z); else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.1e+194], (-N[(t * x), $MachinePrecision]), If[LessEqual[t, 4.2e-156], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 1.9e+211], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.1 \cdot 10^{+194}:\\
\;\;\;\;-t \cdot x\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-156}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+211}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if t < -5.1000000000000002e194Initial program 96.3%
Taylor expanded in y around 0 74.4%
associate-*r/74.4%
associate-*r*74.4%
neg-mul-174.4%
associate-*l/85.4%
*-commutative85.4%
neg-mul-185.4%
*-commutative85.4%
associate-*r/85.2%
metadata-eval85.2%
associate-/r*85.2%
neg-mul-185.2%
associate-*r/85.4%
*-rgt-identity85.4%
neg-sub085.4%
associate--r-85.4%
metadata-eval85.4%
Simplified85.4%
Taylor expanded in z around 0 55.9%
associate-*r*55.9%
mul-1-neg55.9%
Simplified55.9%
if -5.1000000000000002e194 < t < 4.20000000000000025e-156Initial program 93.2%
Taylor expanded in y around inf 78.0%
associate-*l/76.9%
Simplified76.9%
if 4.20000000000000025e-156 < t < 1.90000000000000008e211Initial program 90.3%
frac-2neg90.3%
div-inv90.4%
fma-neg90.4%
distribute-neg-frac90.4%
Applied egg-rr90.4%
fma-udef90.4%
+-commutative90.4%
distribute-lft-neg-out90.4%
unsub-neg90.4%
neg-mul-190.4%
*-commutative90.4%
associate-*r/90.4%
metadata-eval90.4%
associate-/r*90.4%
neg-mul-190.4%
associate-*r/90.4%
*-rgt-identity90.4%
neg-sub090.4%
associate--r-90.4%
metadata-eval90.4%
neg-mul-190.4%
associate-/r*90.4%
metadata-eval90.4%
Simplified90.4%
Taylor expanded in t around 0 65.5%
*-commutative65.5%
associate-*l/66.9%
Simplified66.9%
if 1.90000000000000008e211 < t Initial program 99.8%
Taylor expanded in y around 0 73.6%
associate-*r/73.6%
associate-*r*73.6%
neg-mul-173.6%
associate-*l/94.4%
*-commutative94.4%
neg-mul-194.4%
*-commutative94.4%
associate-*r/94.4%
metadata-eval94.4%
associate-/r*94.4%
neg-mul-194.4%
associate-*r/94.4%
*-rgt-identity94.4%
neg-sub094.4%
associate--r-94.4%
metadata-eval94.4%
Simplified94.4%
Taylor expanded in z around inf 72.5%
Final simplification72.1%
(FPCore (x y z t)
:precision binary64
(if (<= t -4.8e+196)
(- (* t x))
(if (<= t -4.6e-287)
(/ x (/ z y))
(if (<= t 1.5e+210) (* y (/ x z)) (* x (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.8e+196) {
tmp = -(t * x);
} else if (t <= -4.6e-287) {
tmp = x / (z / y);
} else if (t <= 1.5e+210) {
tmp = y * (x / z);
} else {
tmp = x * (t / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-4.8d+196)) then
tmp = -(t * x)
else if (t <= (-4.6d-287)) then
tmp = x / (z / y)
else if (t <= 1.5d+210) then
tmp = y * (x / z)
else
tmp = x * (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.8e+196) {
tmp = -(t * x);
} else if (t <= -4.6e-287) {
tmp = x / (z / y);
} else if (t <= 1.5e+210) {
tmp = y * (x / z);
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -4.8e+196: tmp = -(t * x) elif t <= -4.6e-287: tmp = x / (z / y) elif t <= 1.5e+210: tmp = y * (x / z) else: tmp = x * (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -4.8e+196) tmp = Float64(-Float64(t * x)); elseif (t <= -4.6e-287) tmp = Float64(x / Float64(z / y)); elseif (t <= 1.5e+210) tmp = Float64(y * Float64(x / z)); else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -4.8e+196) tmp = -(t * x); elseif (t <= -4.6e-287) tmp = x / (z / y); elseif (t <= 1.5e+210) tmp = y * (x / z); else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -4.8e+196], (-N[(t * x), $MachinePrecision]), If[LessEqual[t, -4.6e-287], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e+210], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+196}:\\
\;\;\;\;-t \cdot x\\
\mathbf{elif}\;t \leq -4.6 \cdot 10^{-287}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{+210}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if t < -4.8000000000000001e196Initial program 96.3%
Taylor expanded in y around 0 74.4%
associate-*r/74.4%
associate-*r*74.4%
neg-mul-174.4%
associate-*l/85.4%
*-commutative85.4%
neg-mul-185.4%
*-commutative85.4%
associate-*r/85.2%
metadata-eval85.2%
associate-/r*85.2%
neg-mul-185.2%
associate-*r/85.4%
*-rgt-identity85.4%
neg-sub085.4%
associate--r-85.4%
metadata-eval85.4%
Simplified85.4%
Taylor expanded in z around 0 55.9%
associate-*r*55.9%
mul-1-neg55.9%
Simplified55.9%
if -4.8000000000000001e196 < t < -4.59999999999999972e-287Initial program 93.7%
Taylor expanded in y around inf 74.0%
associate-*l/71.5%
Simplified71.5%
*-commutative71.5%
clear-num70.9%
un-div-inv71.7%
Applied egg-rr71.7%
if -4.59999999999999972e-287 < t < 1.50000000000000011e210Initial program 91.0%
frac-2neg91.0%
div-inv90.9%
fma-neg90.9%
distribute-neg-frac90.9%
Applied egg-rr90.9%
fma-udef90.9%
+-commutative90.9%
distribute-lft-neg-out90.9%
unsub-neg90.9%
neg-mul-190.9%
*-commutative90.9%
associate-*r/90.9%
metadata-eval90.9%
associate-/r*90.9%
neg-mul-190.9%
associate-*r/90.9%
*-rgt-identity90.9%
neg-sub090.9%
associate--r-90.9%
metadata-eval90.9%
neg-mul-190.9%
associate-/r*90.9%
metadata-eval90.9%
Simplified90.9%
Taylor expanded in t around 0 75.1%
*-commutative75.1%
associate-*l/76.6%
Simplified76.6%
if 1.50000000000000011e210 < t Initial program 99.8%
Taylor expanded in y around 0 73.6%
associate-*r/73.6%
associate-*r*73.6%
neg-mul-173.6%
associate-*l/94.4%
*-commutative94.4%
neg-mul-194.4%
*-commutative94.4%
associate-*r/94.4%
metadata-eval94.4%
associate-/r*94.4%
neg-mul-194.4%
associate-*r/94.4%
*-rgt-identity94.4%
neg-sub094.4%
associate--r-94.4%
metadata-eval94.4%
Simplified94.4%
Taylor expanded in z around inf 72.5%
Final simplification72.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -8e+14) (not (<= z 1.0))) (* (/ x z) (+ y t)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8e+14) || !(z <= 1.0)) {
tmp = (x / z) * (y + t);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-8d+14)) .or. (.not. (z <= 1.0d0))) then
tmp = (x / z) * (y + t)
else
tmp = x * ((y / z) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8e+14) || !(z <= 1.0)) {
tmp = (x / z) * (y + t);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -8e+14) or not (z <= 1.0): tmp = (x / z) * (y + t) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -8e+14) || !(z <= 1.0)) tmp = Float64(Float64(x / z) * Float64(y + t)); else tmp = Float64(x * Float64(Float64(y / z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -8e+14) || ~((z <= 1.0))) tmp = (x / z) * (y + t); else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8e+14], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(y + t), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+14} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{x}{z} \cdot \left(y + t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -8e14 or 1 < z Initial program 92.4%
Taylor expanded in z around inf 87.8%
*-commutative87.8%
associate-/l*90.0%
associate-/r/89.0%
cancel-sign-sub-inv89.0%
metadata-eval89.0%
*-lft-identity89.0%
Simplified89.0%
if -8e14 < z < 1Initial program 94.0%
Taylor expanded in z around 0 97.3%
associate-*l/93.5%
associate-*r*93.5%
neg-mul-193.5%
distribute-rgt-out93.5%
unsub-neg93.5%
Simplified93.5%
Final simplification91.5%
(FPCore (x y z t) :precision binary64 (if (<= z -5.4e+72) (* x (/ t z)) (if (<= z 1.04e+82) (* x (- (/ y z) t)) (/ t (/ z x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.4e+72) {
tmp = x * (t / z);
} else if (z <= 1.04e+82) {
tmp = x * ((y / z) - t);
} else {
tmp = t / (z / x);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-5.4d+72)) then
tmp = x * (t / z)
else if (z <= 1.04d+82) then
tmp = x * ((y / z) - t)
else
tmp = t / (z / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.4e+72) {
tmp = x * (t / z);
} else if (z <= 1.04e+82) {
tmp = x * ((y / z) - t);
} else {
tmp = t / (z / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.4e+72: tmp = x * (t / z) elif z <= 1.04e+82: tmp = x * ((y / z) - t) else: tmp = t / (z / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.4e+72) tmp = Float64(x * Float64(t / z)); elseif (z <= 1.04e+82) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(t / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.4e+72) tmp = x * (t / z); elseif (z <= 1.04e+82) tmp = x * ((y / z) - t); else tmp = t / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.4e+72], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.04e+82], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{+72}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 1.04 \cdot 10^{+82}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\end{array}
\end{array}
if z < -5.4000000000000001e72Initial program 92.6%
Taylor expanded in y around 0 47.9%
associate-*r/47.9%
associate-*r*47.9%
neg-mul-147.9%
associate-*l/54.2%
*-commutative54.2%
neg-mul-154.2%
*-commutative54.2%
associate-*r/54.2%
metadata-eval54.2%
associate-/r*54.2%
neg-mul-154.2%
associate-*r/54.2%
*-rgt-identity54.2%
neg-sub054.2%
associate--r-54.2%
metadata-eval54.2%
Simplified54.2%
Taylor expanded in z around inf 54.2%
if -5.4000000000000001e72 < z < 1.03999999999999997e82Initial program 94.9%
Taylor expanded in z around 0 91.8%
associate-*l/89.2%
associate-*r*89.2%
neg-mul-189.2%
distribute-rgt-out89.2%
unsub-neg89.2%
Simplified89.2%
if 1.03999999999999997e82 < z Initial program 86.2%
Taylor expanded in y around 0 57.3%
associate-*r/57.3%
associate-*r*57.3%
neg-mul-157.3%
associate-*l/62.9%
*-commutative62.9%
neg-mul-162.9%
*-commutative62.9%
associate-*r/62.8%
metadata-eval62.8%
associate-/r*62.8%
neg-mul-162.8%
associate-*r/62.9%
*-rgt-identity62.9%
neg-sub062.9%
associate--r-62.9%
metadata-eval62.9%
Simplified62.9%
Taylor expanded in z around inf 57.3%
associate-/l*62.9%
Simplified62.9%
Final simplification79.0%
(FPCore (x y z t) :precision binary64 (if (<= z -8e+14) (/ x (/ z (+ y t))) (if (<= z 1.0) (* x (- (/ y z) t)) (* (/ x z) (+ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8e+14) {
tmp = x / (z / (y + t));
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = (x / z) * (y + t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-8d+14)) then
tmp = x / (z / (y + t))
else if (z <= 1.0d0) then
tmp = x * ((y / z) - t)
else
tmp = (x / z) * (y + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8e+14) {
tmp = x / (z / (y + t));
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = (x / z) * (y + t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8e+14: tmp = x / (z / (y + t)) elif z <= 1.0: tmp = x * ((y / z) - t) else: tmp = (x / z) * (y + t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8e+14) tmp = Float64(x / Float64(z / Float64(y + t))); elseif (z <= 1.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(Float64(x / z) * Float64(y + t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -8e+14) tmp = x / (z / (y + t)); elseif (z <= 1.0) tmp = x * ((y / z) - t); else tmp = (x / z) * (y + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8e+14], N[(x / N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y + t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+14}:\\
\;\;\;\;\frac{x}{\frac{z}{y + t}}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(y + t\right)\\
\end{array}
\end{array}
if z < -8e14Initial program 94.2%
Taylor expanded in z around inf 88.0%
*-commutative88.0%
associate-/l*92.3%
neg-mul-192.3%
Simplified92.3%
if -8e14 < z < 1Initial program 94.0%
Taylor expanded in z around 0 97.3%
associate-*l/93.5%
associate-*r*93.5%
neg-mul-193.5%
distribute-rgt-out93.5%
unsub-neg93.5%
Simplified93.5%
if 1 < z Initial program 90.2%
Taylor expanded in z around inf 87.7%
*-commutative87.7%
associate-/l*87.1%
associate-/r/91.1%
cancel-sign-sub-inv91.1%
metadata-eval91.1%
*-lft-identity91.1%
Simplified91.1%
Final simplification92.8%
(FPCore (x y z t) :precision binary64 (if (<= z -8e+14) (* x (+ (/ y z) (/ t z))) (if (<= z 1.0) (* x (- (/ y z) t)) (* (/ x z) (+ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8e+14) {
tmp = x * ((y / z) + (t / z));
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = (x / z) * (y + t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-8d+14)) then
tmp = x * ((y / z) + (t / z))
else if (z <= 1.0d0) then
tmp = x * ((y / z) - t)
else
tmp = (x / z) * (y + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8e+14) {
tmp = x * ((y / z) + (t / z));
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = (x / z) * (y + t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8e+14: tmp = x * ((y / z) + (t / z)) elif z <= 1.0: tmp = x * ((y / z) - t) else: tmp = (x / z) * (y + t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8e+14) tmp = Float64(x * Float64(Float64(y / z) + Float64(t / z))); elseif (z <= 1.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(Float64(x / z) * Float64(y + t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -8e+14) tmp = x * ((y / z) + (t / z)); elseif (z <= 1.0) tmp = x * ((y / z) - t); else tmp = (x / z) * (y + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8e+14], N[(x * N[(N[(y / z), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y + t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(y + t\right)\\
\end{array}
\end{array}
if z < -8e14Initial program 94.2%
Taylor expanded in z around inf 94.2%
associate-*r/94.2%
neg-mul-194.2%
Simplified94.2%
if -8e14 < z < 1Initial program 94.0%
Taylor expanded in z around 0 97.3%
associate-*l/93.5%
associate-*r*93.5%
neg-mul-193.5%
distribute-rgt-out93.5%
unsub-neg93.5%
Simplified93.5%
if 1 < z Initial program 90.2%
Taylor expanded in z around inf 87.7%
*-commutative87.7%
associate-/l*87.1%
associate-/r/91.1%
cancel-sign-sub-inv91.1%
metadata-eval91.1%
*-lft-identity91.1%
Simplified91.1%
Final simplification93.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -8e+14) (not (<= z 1.0))) (* t (/ x z)) (- (* t x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8e+14) || !(z <= 1.0)) {
tmp = t * (x / z);
} else {
tmp = -(t * x);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-8d+14)) .or. (.not. (z <= 1.0d0))) then
tmp = t * (x / z)
else
tmp = -(t * x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8e+14) || !(z <= 1.0)) {
tmp = t * (x / z);
} else {
tmp = -(t * x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -8e+14) or not (z <= 1.0): tmp = t * (x / z) else: tmp = -(t * x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -8e+14) || !(z <= 1.0)) tmp = Float64(t * Float64(x / z)); else tmp = Float64(-Float64(t * x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -8e+14) || ~((z <= 1.0))) tmp = t * (x / z); else tmp = -(t * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8e+14], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], (-N[(t * x), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+14} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;-t \cdot x\\
\end{array}
\end{array}
if z < -8e14 or 1 < z Initial program 92.4%
Taylor expanded in z around inf 87.8%
*-commutative87.8%
associate-/l*90.0%
associate-/r/89.0%
cancel-sign-sub-inv89.0%
metadata-eval89.0%
*-lft-identity89.0%
Simplified89.0%
Taylor expanded in y around 0 49.7%
*-commutative49.7%
associate-*l/52.5%
*-commutative52.5%
Simplified52.5%
if -8e14 < z < 1Initial program 94.0%
Taylor expanded in y around 0 32.1%
associate-*r/32.1%
associate-*r*32.1%
neg-mul-132.1%
associate-*l/32.1%
*-commutative32.1%
neg-mul-132.1%
*-commutative32.1%
associate-*r/32.1%
metadata-eval32.1%
associate-/r*32.1%
neg-mul-132.1%
associate-*r/32.1%
*-rgt-identity32.1%
neg-sub032.1%
associate--r-32.1%
metadata-eval32.1%
Simplified32.1%
Taylor expanded in z around 0 31.6%
associate-*r*31.6%
mul-1-neg31.6%
Simplified31.6%
Final simplification40.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -8e+14) (not (<= z 1.0))) (* x (/ t z)) (- (* t x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8e+14) || !(z <= 1.0)) {
tmp = x * (t / z);
} else {
tmp = -(t * x);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-8d+14)) .or. (.not. (z <= 1.0d0))) then
tmp = x * (t / z)
else
tmp = -(t * x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8e+14) || !(z <= 1.0)) {
tmp = x * (t / z);
} else {
tmp = -(t * x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -8e+14) or not (z <= 1.0): tmp = x * (t / z) else: tmp = -(t * x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -8e+14) || !(z <= 1.0)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(-Float64(t * x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -8e+14) || ~((z <= 1.0))) tmp = x * (t / z); else tmp = -(t * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8e+14], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], (-N[(t * x), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+14} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;-t \cdot x\\
\end{array}
\end{array}
if z < -8e14 or 1 < z Initial program 92.4%
Taylor expanded in y around 0 50.4%
associate-*r/50.4%
associate-*r*50.4%
neg-mul-150.4%
associate-*l/54.9%
*-commutative54.9%
neg-mul-154.9%
*-commutative54.9%
associate-*r/54.8%
metadata-eval54.8%
associate-/r*54.8%
neg-mul-154.8%
associate-*r/54.9%
*-rgt-identity54.9%
neg-sub054.9%
associate--r-54.9%
metadata-eval54.9%
Simplified54.9%
Taylor expanded in z around inf 54.2%
if -8e14 < z < 1Initial program 94.0%
Taylor expanded in y around 0 32.1%
associate-*r/32.1%
associate-*r*32.1%
neg-mul-132.1%
associate-*l/32.1%
*-commutative32.1%
neg-mul-132.1%
*-commutative32.1%
associate-*r/32.1%
metadata-eval32.1%
associate-/r*32.1%
neg-mul-132.1%
associate-*r/32.1%
*-rgt-identity32.1%
neg-sub032.1%
associate--r-32.1%
metadata-eval32.1%
Simplified32.1%
Taylor expanded in z around 0 31.6%
associate-*r*31.6%
mul-1-neg31.6%
Simplified31.6%
Final simplification41.4%
(FPCore (x y z t) :precision binary64 (if (<= t -2.2e+207) (- (* t x)) (if (<= t 1.6e+210) (* y (/ x z)) (* x (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.2e+207) {
tmp = -(t * x);
} else if (t <= 1.6e+210) {
tmp = y * (x / z);
} else {
tmp = x * (t / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2.2d+207)) then
tmp = -(t * x)
else if (t <= 1.6d+210) then
tmp = y * (x / z)
else
tmp = x * (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.2e+207) {
tmp = -(t * x);
} else if (t <= 1.6e+210) {
tmp = y * (x / z);
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.2e+207: tmp = -(t * x) elif t <= 1.6e+210: tmp = y * (x / z) else: tmp = x * (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.2e+207) tmp = Float64(-Float64(t * x)); elseif (t <= 1.6e+210) tmp = Float64(y * Float64(x / z)); else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.2e+207) tmp = -(t * x); elseif (t <= 1.6e+210) tmp = y * (x / z); else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.2e+207], (-N[(t * x), $MachinePrecision]), If[LessEqual[t, 1.6e+210], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+207}:\\
\;\;\;\;-t \cdot x\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{+210}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if t < -2.20000000000000009e207Initial program 100.0%
Taylor expanded in y around 0 79.3%
associate-*r/79.3%
associate-*r*79.3%
neg-mul-179.3%
associate-*l/91.6%
*-commutative91.6%
neg-mul-191.6%
*-commutative91.6%
associate-*r/91.5%
metadata-eval91.5%
associate-/r*91.5%
neg-mul-191.5%
associate-*r/91.6%
*-rgt-identity91.6%
neg-sub091.6%
associate--r-91.6%
metadata-eval91.6%
Simplified91.6%
Taylor expanded in z around 0 58.4%
associate-*r*58.4%
mul-1-neg58.4%
Simplified58.4%
if -2.20000000000000009e207 < t < 1.6000000000000001e210Initial program 92.1%
frac-2neg92.1%
div-inv92.0%
fma-neg92.0%
distribute-neg-frac92.0%
Applied egg-rr92.0%
fma-udef92.0%
+-commutative92.0%
distribute-lft-neg-out92.0%
unsub-neg92.0%
neg-mul-192.0%
*-commutative92.0%
associate-*r/92.0%
metadata-eval92.0%
associate-/r*92.0%
neg-mul-192.0%
associate-*r/92.0%
*-rgt-identity92.0%
neg-sub092.0%
associate--r-92.0%
metadata-eval92.0%
neg-mul-192.0%
associate-/r*92.0%
metadata-eval92.0%
Simplified92.0%
Taylor expanded in t around 0 74.4%
*-commutative74.4%
associate-*l/71.6%
Simplified71.6%
if 1.6000000000000001e210 < t Initial program 99.8%
Taylor expanded in y around 0 73.6%
associate-*r/73.6%
associate-*r*73.6%
neg-mul-173.6%
associate-*l/94.4%
*-commutative94.4%
neg-mul-194.4%
*-commutative94.4%
associate-*r/94.4%
metadata-eval94.4%
associate-/r*94.4%
neg-mul-194.4%
associate-*r/94.4%
*-rgt-identity94.4%
neg-sub094.4%
associate--r-94.4%
metadata-eval94.4%
Simplified94.4%
Taylor expanded in z around inf 72.5%
Final simplification70.4%
(FPCore (x y z t) :precision binary64 (if (<= t -1.5e+207) (- (* t x)) (if (<= t 3.2e+210) (/ (* y x) z) (* x (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.5e+207) {
tmp = -(t * x);
} else if (t <= 3.2e+210) {
tmp = (y * x) / z;
} else {
tmp = x * (t / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.5d+207)) then
tmp = -(t * x)
else if (t <= 3.2d+210) then
tmp = (y * x) / z
else
tmp = x * (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.5e+207) {
tmp = -(t * x);
} else if (t <= 3.2e+210) {
tmp = (y * x) / z;
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.5e+207: tmp = -(t * x) elif t <= 3.2e+210: tmp = (y * x) / z else: tmp = x * (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.5e+207) tmp = Float64(-Float64(t * x)); elseif (t <= 3.2e+210) tmp = Float64(Float64(y * x) / z); else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.5e+207) tmp = -(t * x); elseif (t <= 3.2e+210) tmp = (y * x) / z; else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.5e+207], (-N[(t * x), $MachinePrecision]), If[LessEqual[t, 3.2e+210], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+207}:\\
\;\;\;\;-t \cdot x\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{+210}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if t < -1.49999999999999992e207Initial program 100.0%
Taylor expanded in y around 0 79.3%
associate-*r/79.3%
associate-*r*79.3%
neg-mul-179.3%
associate-*l/91.6%
*-commutative91.6%
neg-mul-191.6%
*-commutative91.6%
associate-*r/91.5%
metadata-eval91.5%
associate-/r*91.5%
neg-mul-191.5%
associate-*r/91.6%
*-rgt-identity91.6%
neg-sub091.6%
associate--r-91.6%
metadata-eval91.6%
Simplified91.6%
Taylor expanded in z around 0 58.4%
associate-*r*58.4%
mul-1-neg58.4%
Simplified58.4%
if -1.49999999999999992e207 < t < 3.2000000000000002e210Initial program 92.1%
Taylor expanded in y around inf 74.4%
if 3.2000000000000002e210 < t Initial program 99.8%
Taylor expanded in y around 0 73.6%
associate-*r/73.6%
associate-*r*73.6%
neg-mul-173.6%
associate-*l/94.4%
*-commutative94.4%
neg-mul-194.4%
*-commutative94.4%
associate-*r/94.4%
metadata-eval94.4%
associate-/r*94.4%
neg-mul-194.4%
associate-*r/94.4%
*-rgt-identity94.4%
neg-sub094.4%
associate--r-94.4%
metadata-eval94.4%
Simplified94.4%
Taylor expanded in z around inf 72.5%
Final simplification72.8%
(FPCore (x y z t) :precision binary64 (- (* t x)))
double code(double x, double y, double z, double t) {
return -(t * x);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -(t * x)
end function
public static double code(double x, double y, double z, double t) {
return -(t * x);
}
def code(x, y, z, t): return -(t * x)
function code(x, y, z, t) return Float64(-Float64(t * x)) end
function tmp = code(x, y, z, t) tmp = -(t * x); end
code[x_, y_, z_, t_] := (-N[(t * x), $MachinePrecision])
\begin{array}{l}
\\
-t \cdot x
\end{array}
Initial program 93.3%
Taylor expanded in y around 0 40.0%
associate-*r/40.0%
associate-*r*40.0%
neg-mul-140.0%
associate-*l/42.0%
*-commutative42.0%
neg-mul-142.0%
*-commutative42.0%
associate-*r/42.0%
metadata-eval42.0%
associate-/r*42.0%
neg-mul-142.0%
associate-*r/42.0%
*-rgt-identity42.0%
neg-sub042.0%
associate--r-42.0%
metadata-eval42.0%
Simplified42.0%
Taylor expanded in z around 0 23.0%
associate-*r*23.0%
mul-1-neg23.0%
Simplified23.0%
Final simplification23.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))))
(t_2 (* x (- (/ y z) (/ t (- 1.0 z))))))
(if (< t_2 -7.623226303312042e-196)
t_1
(if (< t_2 1.4133944927702302e-211)
(+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z))))
t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 < -7.623226303312042e-196) {
tmp = t_1;
} else if (t_2 < 1.4133944927702302e-211) {
tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * ((y / z) - (t * (1.0d0 / (1.0d0 - z))))
t_2 = x * ((y / z) - (t / (1.0d0 - z)))
if (t_2 < (-7.623226303312042d-196)) then
tmp = t_1
else if (t_2 < 1.4133944927702302d-211) then
tmp = ((y * x) / z) + -((t * x) / (1.0d0 - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 < -7.623226303312042e-196) {
tmp = t_1;
} else if (t_2 < 1.4133944927702302e-211) {
tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z)))) t_2 = x * ((y / z) - (t / (1.0 - z))) tmp = 0 if t_2 < -7.623226303312042e-196: tmp = t_1 elif t_2 < 1.4133944927702302e-211: tmp = ((y * x) / z) + -((t * x) / (1.0 - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - Float64(t * Float64(1.0 / Float64(1.0 - z))))) t_2 = Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) tmp = 0.0 if (t_2 < -7.623226303312042e-196) tmp = t_1; elseif (t_2 < 1.4133944927702302e-211) tmp = Float64(Float64(Float64(y * x) / z) + Float64(-Float64(Float64(t * x) / Float64(1.0 - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z)))); t_2 = x * ((y / z) - (t / (1.0 - z))); tmp = 0.0; if (t_2 < -7.623226303312042e-196) tmp = t_1; elseif (t_2 < 1.4133944927702302e-211) tmp = ((y * x) / z) + -((t * x) / (1.0 - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t * N[(1.0 / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -7.623226303312042e-196], t$95$1, If[Less[t$95$2, 1.4133944927702302e-211], N[(N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision] + (-N[(N[(t * x), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\
t_2 := x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\
\mathbf{if}\;t_2 < -7.623226303312042 \cdot 10^{-196}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 < 1.4133944927702302 \cdot 10^{-211}:\\
\;\;\;\;\frac{y \cdot x}{z} + \left(-\frac{t \cdot x}{1 - z}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023185
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:herbie-target
(if (< (* x (- (/ y z) (/ t (- 1.0 z)))) -7.623226303312042e-196) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))) (if (< (* x (- (/ y z) (/ t (- 1.0 z)))) 1.4133944927702302e-211) (+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z)))) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z)))))))
(* x (- (/ y z) (/ t (- 1.0 z)))))