
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
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 - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
def code(x, y, z, t): return x + ((y * (z - x)) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(y * Float64(z - x)) / t)) end
function tmp = code(x, y, z, t) tmp = x + ((y * (z - x)) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - x\right)}{t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
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 - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
def code(x, y, z, t): return x + ((y * (z - x)) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(y * Float64(z - x)) / t)) end
function tmp = code(x, y, z, t) tmp = x + ((y * (z - x)) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - x\right)}{t}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= y -15000000.0) (+ x (/ y (/ t (- z x)))) (+ x (* (- z x) (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -15000000.0) {
tmp = x + (y / (t / (z - x)));
} else {
tmp = x + ((z - x) * (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 (y <= (-15000000.0d0)) then
tmp = x + (y / (t / (z - x)))
else
tmp = x + ((z - x) * (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -15000000.0) {
tmp = x + (y / (t / (z - x)));
} else {
tmp = x + ((z - x) * (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -15000000.0: tmp = x + (y / (t / (z - x))) else: tmp = x + ((z - x) * (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -15000000.0) tmp = Float64(x + Float64(y / Float64(t / Float64(z - x)))); else tmp = Float64(x + Float64(Float64(z - x) * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -15000000.0) tmp = x + (y / (t / (z - x))); else tmp = x + ((z - x) * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -15000000.0], N[(x + N[(y / N[(t / N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -15000000:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - x}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - x\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if y < -1.5e7Initial program 79.3%
associate-/l*99.9%
Simplified99.9%
if -1.5e7 < y Initial program 92.9%
associate-*l/98.1%
Simplified98.1%
Final simplification98.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ z (/ t y))) (t_2 (* x (/ y (- t)))))
(if (<= z -2.2e+141)
(* y (/ z t))
(if (<= z -1.05e+101)
x
(if (<= z -5.8e+15)
t_1
(if (<= z -1.8e-59)
x
(if (<= z -8.5e-179)
t_2
(if (<= z -1.05e-285)
x
(if (<= z 4.1e-272) t_2 (if (<= z 1.6e-85) x t_1))))))))))
double code(double x, double y, double z, double t) {
double t_1 = z / (t / y);
double t_2 = x * (y / -t);
double tmp;
if (z <= -2.2e+141) {
tmp = y * (z / t);
} else if (z <= -1.05e+101) {
tmp = x;
} else if (z <= -5.8e+15) {
tmp = t_1;
} else if (z <= -1.8e-59) {
tmp = x;
} else if (z <= -8.5e-179) {
tmp = t_2;
} else if (z <= -1.05e-285) {
tmp = x;
} else if (z <= 4.1e-272) {
tmp = t_2;
} else if (z <= 1.6e-85) {
tmp = x;
} 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 = z / (t / y)
t_2 = x * (y / -t)
if (z <= (-2.2d+141)) then
tmp = y * (z / t)
else if (z <= (-1.05d+101)) then
tmp = x
else if (z <= (-5.8d+15)) then
tmp = t_1
else if (z <= (-1.8d-59)) then
tmp = x
else if (z <= (-8.5d-179)) then
tmp = t_2
else if (z <= (-1.05d-285)) then
tmp = x
else if (z <= 4.1d-272) then
tmp = t_2
else if (z <= 1.6d-85) then
tmp = x
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 = z / (t / y);
double t_2 = x * (y / -t);
double tmp;
if (z <= -2.2e+141) {
tmp = y * (z / t);
} else if (z <= -1.05e+101) {
tmp = x;
} else if (z <= -5.8e+15) {
tmp = t_1;
} else if (z <= -1.8e-59) {
tmp = x;
} else if (z <= -8.5e-179) {
tmp = t_2;
} else if (z <= -1.05e-285) {
tmp = x;
} else if (z <= 4.1e-272) {
tmp = t_2;
} else if (z <= 1.6e-85) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z / (t / y) t_2 = x * (y / -t) tmp = 0 if z <= -2.2e+141: tmp = y * (z / t) elif z <= -1.05e+101: tmp = x elif z <= -5.8e+15: tmp = t_1 elif z <= -1.8e-59: tmp = x elif z <= -8.5e-179: tmp = t_2 elif z <= -1.05e-285: tmp = x elif z <= 4.1e-272: tmp = t_2 elif z <= 1.6e-85: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z / Float64(t / y)) t_2 = Float64(x * Float64(y / Float64(-t))) tmp = 0.0 if (z <= -2.2e+141) tmp = Float64(y * Float64(z / t)); elseif (z <= -1.05e+101) tmp = x; elseif (z <= -5.8e+15) tmp = t_1; elseif (z <= -1.8e-59) tmp = x; elseif (z <= -8.5e-179) tmp = t_2; elseif (z <= -1.05e-285) tmp = x; elseif (z <= 4.1e-272) tmp = t_2; elseif (z <= 1.6e-85) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z / (t / y); t_2 = x * (y / -t); tmp = 0.0; if (z <= -2.2e+141) tmp = y * (z / t); elseif (z <= -1.05e+101) tmp = x; elseif (z <= -5.8e+15) tmp = t_1; elseif (z <= -1.8e-59) tmp = x; elseif (z <= -8.5e-179) tmp = t_2; elseif (z <= -1.05e-285) tmp = x; elseif (z <= 4.1e-272) tmp = t_2; elseif (z <= 1.6e-85) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+141], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.05e+101], x, If[LessEqual[z, -5.8e+15], t$95$1, If[LessEqual[z, -1.8e-59], x, If[LessEqual[z, -8.5e-179], t$95$2, If[LessEqual[z, -1.05e-285], x, If[LessEqual[z, 4.1e-272], t$95$2, If[LessEqual[z, 1.6e-85], x, t$95$1]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{\frac{t}{y}}\\
t_2 := x \cdot \frac{y}{-t}\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+141}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{+101}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-59}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-179}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-285}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{-272}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-85}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.2e141Initial program 92.5%
+-commutative92.5%
associate-*r/90.0%
fma-def90.0%
Simplified90.0%
Taylor expanded in y around inf 72.3%
Taylor expanded in z around inf 67.3%
if -2.2e141 < z < -1.05e101 or -5.8e15 < z < -1.8e-59 or -8.49999999999999932e-179 < z < -1.04999999999999992e-285 or 4.0999999999999997e-272 < z < 1.60000000000000014e-85Initial program 88.4%
+-commutative88.4%
associate-*r/96.1%
fma-def96.1%
Simplified96.1%
Taylor expanded in y around 0 68.6%
if -1.05e101 < z < -5.8e15 or 1.60000000000000014e-85 < z Initial program 88.6%
+-commutative88.6%
associate-*r/91.0%
fma-def91.0%
Simplified91.0%
Taylor expanded in y around inf 68.3%
Taylor expanded in z around inf 64.7%
*-commutative64.7%
associate-/r/69.3%
Applied egg-rr69.3%
if -1.8e-59 < z < -8.49999999999999932e-179 or -1.04999999999999992e-285 < z < 4.0999999999999997e-272Initial program 91.3%
+-commutative91.3%
associate-*r/94.4%
fma-def94.4%
Simplified94.4%
Taylor expanded in y around inf 77.6%
Taylor expanded in z around 0 77.6%
mul-1-neg77.6%
sub-neg77.6%
div-sub77.6%
Simplified77.6%
Taylor expanded in z around 0 58.6%
associate-*r/58.6%
associate-*l/58.7%
metadata-eval58.7%
associate-/r*58.7%
neg-mul-158.7%
*-commutative58.7%
*-commutative58.7%
associate-*l*66.8%
*-commutative66.8%
associate-*l/66.9%
*-lft-identity66.9%
Simplified66.9%
Final simplification68.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ z (/ t y))))
(if (<= z -2.4e+141)
(* y (/ z t))
(if (<= z -8.4e+101)
x
(if (<= z -2.3e+15)
t_1
(if (<= z -3.9e-61)
x
(if (<= z -2.05e-177)
(* x (/ y (- t)))
(if (<= z -6.6e-286)
x
(if (<= z 2.1e-273)
(* y (/ (- x) t))
(if (<= z 1.4e-85) x t_1))))))))))
double code(double x, double y, double z, double t) {
double t_1 = z / (t / y);
double tmp;
if (z <= -2.4e+141) {
tmp = y * (z / t);
} else if (z <= -8.4e+101) {
tmp = x;
} else if (z <= -2.3e+15) {
tmp = t_1;
} else if (z <= -3.9e-61) {
tmp = x;
} else if (z <= -2.05e-177) {
tmp = x * (y / -t);
} else if (z <= -6.6e-286) {
tmp = x;
} else if (z <= 2.1e-273) {
tmp = y * (-x / t);
} else if (z <= 1.4e-85) {
tmp = x;
} 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 = z / (t / y)
if (z <= (-2.4d+141)) then
tmp = y * (z / t)
else if (z <= (-8.4d+101)) then
tmp = x
else if (z <= (-2.3d+15)) then
tmp = t_1
else if (z <= (-3.9d-61)) then
tmp = x
else if (z <= (-2.05d-177)) then
tmp = x * (y / -t)
else if (z <= (-6.6d-286)) then
tmp = x
else if (z <= 2.1d-273) then
tmp = y * (-x / t)
else if (z <= 1.4d-85) then
tmp = x
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 = z / (t / y);
double tmp;
if (z <= -2.4e+141) {
tmp = y * (z / t);
} else if (z <= -8.4e+101) {
tmp = x;
} else if (z <= -2.3e+15) {
tmp = t_1;
} else if (z <= -3.9e-61) {
tmp = x;
} else if (z <= -2.05e-177) {
tmp = x * (y / -t);
} else if (z <= -6.6e-286) {
tmp = x;
} else if (z <= 2.1e-273) {
tmp = y * (-x / t);
} else if (z <= 1.4e-85) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z / (t / y) tmp = 0 if z <= -2.4e+141: tmp = y * (z / t) elif z <= -8.4e+101: tmp = x elif z <= -2.3e+15: tmp = t_1 elif z <= -3.9e-61: tmp = x elif z <= -2.05e-177: tmp = x * (y / -t) elif z <= -6.6e-286: tmp = x elif z <= 2.1e-273: tmp = y * (-x / t) elif z <= 1.4e-85: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z / Float64(t / y)) tmp = 0.0 if (z <= -2.4e+141) tmp = Float64(y * Float64(z / t)); elseif (z <= -8.4e+101) tmp = x; elseif (z <= -2.3e+15) tmp = t_1; elseif (z <= -3.9e-61) tmp = x; elseif (z <= -2.05e-177) tmp = Float64(x * Float64(y / Float64(-t))); elseif (z <= -6.6e-286) tmp = x; elseif (z <= 2.1e-273) tmp = Float64(y * Float64(Float64(-x) / t)); elseif (z <= 1.4e-85) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z / (t / y); tmp = 0.0; if (z <= -2.4e+141) tmp = y * (z / t); elseif (z <= -8.4e+101) tmp = x; elseif (z <= -2.3e+15) tmp = t_1; elseif (z <= -3.9e-61) tmp = x; elseif (z <= -2.05e-177) tmp = x * (y / -t); elseif (z <= -6.6e-286) tmp = x; elseif (z <= 2.1e-273) tmp = y * (-x / t); elseif (z <= 1.4e-85) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e+141], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.4e+101], x, If[LessEqual[z, -2.3e+15], t$95$1, If[LessEqual[z, -3.9e-61], x, If[LessEqual[z, -2.05e-177], N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.6e-286], x, If[LessEqual[z, 2.1e-273], N[(y * N[((-x) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-85], x, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{\frac{t}{y}}\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+141}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{elif}\;z \leq -8.4 \cdot 10^{+101}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{-61}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -2.05 \cdot 10^{-177}:\\
\;\;\;\;x \cdot \frac{y}{-t}\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-286}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-273}:\\
\;\;\;\;y \cdot \frac{-x}{t}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-85}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.39999999999999997e141Initial program 92.5%
+-commutative92.5%
associate-*r/90.0%
fma-def90.0%
Simplified90.0%
Taylor expanded in y around inf 72.3%
Taylor expanded in z around inf 67.3%
if -2.39999999999999997e141 < z < -8.4000000000000001e101 or -2.3e15 < z < -3.90000000000000033e-61 or -2.05e-177 < z < -6.5999999999999997e-286 or 2.1000000000000002e-273 < z < 1.40000000000000008e-85Initial program 88.4%
+-commutative88.4%
associate-*r/96.1%
fma-def96.1%
Simplified96.1%
Taylor expanded in y around 0 68.6%
if -8.4000000000000001e101 < z < -2.3e15 or 1.40000000000000008e-85 < z Initial program 88.6%
+-commutative88.6%
associate-*r/91.0%
fma-def91.0%
Simplified91.0%
Taylor expanded in y around inf 68.3%
Taylor expanded in z around inf 64.7%
*-commutative64.7%
associate-/r/69.3%
Applied egg-rr69.3%
if -3.90000000000000033e-61 < z < -2.05e-177Initial program 91.9%
+-commutative91.9%
associate-*r/91.9%
fma-def91.9%
Simplified91.9%
Taylor expanded in y around inf 75.5%
Taylor expanded in z around 0 75.5%
mul-1-neg75.5%
sub-neg75.5%
div-sub75.5%
Simplified75.5%
Taylor expanded in z around 0 56.0%
associate-*r/56.0%
associate-*l/56.0%
metadata-eval56.0%
associate-/r*56.0%
neg-mul-156.0%
*-commutative56.0%
*-commutative56.0%
associate-*l*63.7%
*-commutative63.7%
associate-*l/63.8%
*-lft-identity63.8%
Simplified63.8%
if -6.5999999999999997e-286 < z < 2.1000000000000002e-273Initial program 89.9%
+-commutative89.9%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in y around inf 82.4%
Taylor expanded in z around 0 74.1%
associate-*r/74.1%
neg-mul-174.1%
Simplified74.1%
Final simplification68.4%
(FPCore (x y z t)
:precision binary64
(if (<= t -3.15e-106)
(+ x (/ y (/ t z)))
(if (or (<= t -1.46e-221) (and (not (<= t 5.4e-308)) (<= t 6.6e-57)))
(* y (/ (- z x) t))
(+ x (* z (/ y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.15e-106) {
tmp = x + (y / (t / z));
} else if ((t <= -1.46e-221) || (!(t <= 5.4e-308) && (t <= 6.6e-57))) {
tmp = y * ((z - x) / 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 (t <= (-3.15d-106)) then
tmp = x + (y / (t / z))
else if ((t <= (-1.46d-221)) .or. (.not. (t <= 5.4d-308)) .and. (t <= 6.6d-57)) then
tmp = y * ((z - x) / 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 (t <= -3.15e-106) {
tmp = x + (y / (t / z));
} else if ((t <= -1.46e-221) || (!(t <= 5.4e-308) && (t <= 6.6e-57))) {
tmp = y * ((z - x) / t);
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.15e-106: tmp = x + (y / (t / z)) elif (t <= -1.46e-221) or (not (t <= 5.4e-308) and (t <= 6.6e-57)): tmp = y * ((z - x) / t) else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.15e-106) tmp = Float64(x + Float64(y / Float64(t / z))); elseif ((t <= -1.46e-221) || (!(t <= 5.4e-308) && (t <= 6.6e-57))) tmp = Float64(y * Float64(Float64(z - x) / t)); else tmp = Float64(x + Float64(z * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -3.15e-106) tmp = x + (y / (t / z)); elseif ((t <= -1.46e-221) || (~((t <= 5.4e-308)) && (t <= 6.6e-57))) tmp = y * ((z - x) / t); else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.15e-106], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1.46e-221], And[N[Not[LessEqual[t, 5.4e-308]], $MachinePrecision], LessEqual[t, 6.6e-57]]], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.15 \cdot 10^{-106}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq -1.46 \cdot 10^{-221} \lor \neg \left(t \leq 5.4 \cdot 10^{-308}\right) \land t \leq 6.6 \cdot 10^{-57}:\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -3.1500000000000002e-106Initial program 86.7%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in z around inf 85.9%
if -3.1500000000000002e-106 < t < -1.46000000000000004e-221 or 5.4000000000000003e-308 < t < 6.5999999999999997e-57Initial program 98.3%
+-commutative98.3%
associate-*r/94.6%
fma-def94.6%
Simplified94.6%
Taylor expanded in y around inf 85.4%
Taylor expanded in z around 0 85.4%
mul-1-neg85.4%
sub-neg85.4%
div-sub86.7%
Simplified86.7%
if -1.46000000000000004e-221 < t < 5.4000000000000003e-308 or 6.5999999999999997e-57 < t Initial program 85.4%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in z around inf 82.5%
associate-*l/89.3%
*-commutative89.3%
Simplified89.3%
Final simplification87.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* z (/ y t)))) (t_2 (* y (/ (- z x) t))))
(if (<= y -1.7e+53)
t_2
(if (<= y -4.5e-93)
t_1
(if (<= y -1.4e-118) (* x (/ y (- t))) (if (<= y 2.1e+91) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (z * (y / t));
double t_2 = y * ((z - x) / t);
double tmp;
if (y <= -1.7e+53) {
tmp = t_2;
} else if (y <= -4.5e-93) {
tmp = t_1;
} else if (y <= -1.4e-118) {
tmp = x * (y / -t);
} else if (y <= 2.1e+91) {
tmp = t_1;
} else {
tmp = t_2;
}
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 + (z * (y / t))
t_2 = y * ((z - x) / t)
if (y <= (-1.7d+53)) then
tmp = t_2
else if (y <= (-4.5d-93)) then
tmp = t_1
else if (y <= (-1.4d-118)) then
tmp = x * (y / -t)
else if (y <= 2.1d+91) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x + (z * (y / t));
double t_2 = y * ((z - x) / t);
double tmp;
if (y <= -1.7e+53) {
tmp = t_2;
} else if (y <= -4.5e-93) {
tmp = t_1;
} else if (y <= -1.4e-118) {
tmp = x * (y / -t);
} else if (y <= 2.1e+91) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (z * (y / t)) t_2 = y * ((z - x) / t) tmp = 0 if y <= -1.7e+53: tmp = t_2 elif y <= -4.5e-93: tmp = t_1 elif y <= -1.4e-118: tmp = x * (y / -t) elif y <= 2.1e+91: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(z * Float64(y / t))) t_2 = Float64(y * Float64(Float64(z - x) / t)) tmp = 0.0 if (y <= -1.7e+53) tmp = t_2; elseif (y <= -4.5e-93) tmp = t_1; elseif (y <= -1.4e-118) tmp = Float64(x * Float64(y / Float64(-t))); elseif (y <= 2.1e+91) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (z * (y / t)); t_2 = y * ((z - x) / t); tmp = 0.0; if (y <= -1.7e+53) tmp = t_2; elseif (y <= -4.5e-93) tmp = t_1; elseif (y <= -1.4e-118) tmp = x * (y / -t); elseif (y <= 2.1e+91) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.7e+53], t$95$2, If[LessEqual[y, -4.5e-93], t$95$1, If[LessEqual[y, -1.4e-118], N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e+91], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{t}\\
t_2 := y \cdot \frac{z - x}{t}\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{+53}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{-93}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-118}:\\
\;\;\;\;x \cdot \frac{y}{-t}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+91}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.69999999999999999e53 or 2.10000000000000008e91 < y Initial program 76.2%
+-commutative76.2%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in y around inf 85.4%
Taylor expanded in z around 0 85.4%
mul-1-neg85.4%
sub-neg85.4%
div-sub85.4%
Simplified85.4%
if -1.69999999999999999e53 < y < -4.5000000000000002e-93 or -1.4e-118 < y < 2.10000000000000008e91Initial program 97.4%
associate-*l/98.2%
Simplified98.2%
Taylor expanded in z around inf 89.0%
associate-*l/88.0%
*-commutative88.0%
Simplified88.0%
if -4.5000000000000002e-93 < y < -1.4e-118Initial program 97.3%
+-commutative97.3%
associate-*r/62.2%
fma-def62.2%
Simplified62.2%
Taylor expanded in y around inf 62.2%
Taylor expanded in z around 0 62.2%
mul-1-neg62.2%
sub-neg62.2%
div-sub62.2%
Simplified62.2%
Taylor expanded in z around 0 97.3%
associate-*r/97.3%
associate-*l/97.6%
metadata-eval97.6%
associate-/r*97.6%
neg-mul-197.6%
*-commutative97.6%
*-commutative97.6%
associate-*l*100.0%
*-commutative100.0%
associate-*l/100.0%
*-lft-identity100.0%
Simplified100.0%
Final simplification87.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (/ (- z x) t))))
(if (<= t -2.25e-106)
(+ x (/ y (/ t z)))
(if (<= t -1.6e-221)
t_1
(if (<= t 4.4e-305)
(+ x (/ z (/ t y)))
(if (<= t 1.6e-57) t_1 (+ x (* z (/ y t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * ((z - x) / t);
double tmp;
if (t <= -2.25e-106) {
tmp = x + (y / (t / z));
} else if (t <= -1.6e-221) {
tmp = t_1;
} else if (t <= 4.4e-305) {
tmp = x + (z / (t / y));
} else if (t <= 1.6e-57) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = y * ((z - x) / t)
if (t <= (-2.25d-106)) then
tmp = x + (y / (t / z))
else if (t <= (-1.6d-221)) then
tmp = t_1
else if (t <= 4.4d-305) then
tmp = x + (z / (t / y))
else if (t <= 1.6d-57) then
tmp = t_1
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 t_1 = y * ((z - x) / t);
double tmp;
if (t <= -2.25e-106) {
tmp = x + (y / (t / z));
} else if (t <= -1.6e-221) {
tmp = t_1;
} else if (t <= 4.4e-305) {
tmp = x + (z / (t / y));
} else if (t <= 1.6e-57) {
tmp = t_1;
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t): t_1 = y * ((z - x) / t) tmp = 0 if t <= -2.25e-106: tmp = x + (y / (t / z)) elif t <= -1.6e-221: tmp = t_1 elif t <= 4.4e-305: tmp = x + (z / (t / y)) elif t <= 1.6e-57: tmp = t_1 else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(Float64(z - x) / t)) tmp = 0.0 if (t <= -2.25e-106) tmp = Float64(x + Float64(y / Float64(t / z))); elseif (t <= -1.6e-221) tmp = t_1; elseif (t <= 4.4e-305) tmp = Float64(x + Float64(z / Float64(t / y))); elseif (t <= 1.6e-57) tmp = t_1; else tmp = Float64(x + Float64(z * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * ((z - x) / t); tmp = 0.0; if (t <= -2.25e-106) tmp = x + (y / (t / z)); elseif (t <= -1.6e-221) tmp = t_1; elseif (t <= 4.4e-305) tmp = x + (z / (t / y)); elseif (t <= 1.6e-57) tmp = t_1; else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.25e-106], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.6e-221], t$95$1, If[LessEqual[t, 4.4e-305], N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.6e-57], t$95$1, N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - x}{t}\\
\mathbf{if}\;t \leq -2.25 \cdot 10^{-106}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq -1.6 \cdot 10^{-221}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-305}:\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{-57}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -2.24999999999999978e-106Initial program 86.7%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in z around inf 85.9%
if -2.24999999999999978e-106 < t < -1.60000000000000008e-221 or 4.39999999999999993e-305 < t < 1.6e-57Initial program 98.3%
+-commutative98.3%
associate-*r/94.6%
fma-def94.6%
Simplified94.6%
Taylor expanded in y around inf 85.4%
Taylor expanded in z around 0 85.4%
mul-1-neg85.4%
sub-neg85.4%
div-sub86.7%
Simplified86.7%
if -1.60000000000000008e-221 < t < 4.39999999999999993e-305Initial program 99.9%
associate-*l/95.9%
Simplified95.9%
Taylor expanded in z around inf 76.3%
associate-*l/76.3%
*-commutative76.3%
Simplified76.3%
clear-num76.2%
div-inv76.4%
Applied egg-rr76.4%
if 1.6e-57 < t Initial program 80.6%
associate-*l/98.9%
Simplified98.9%
Taylor expanded in z around inf 84.5%
associate-*l/93.6%
*-commutative93.6%
Simplified93.6%
Final simplification87.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (/ (- z x) t))))
(if (<= y -8.4e+51)
t_1
(if (<= y -4.5e-93)
(+ x (/ z (/ t y)))
(if (<= y -1.4e-118)
(* x (/ y (- t)))
(if (<= y 1.9e+94) (+ x (/ (* y z) t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * ((z - x) / t);
double tmp;
if (y <= -8.4e+51) {
tmp = t_1;
} else if (y <= -4.5e-93) {
tmp = x + (z / (t / y));
} else if (y <= -1.4e-118) {
tmp = x * (y / -t);
} else if (y <= 1.9e+94) {
tmp = x + ((y * z) / t);
} 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 = y * ((z - x) / t)
if (y <= (-8.4d+51)) then
tmp = t_1
else if (y <= (-4.5d-93)) then
tmp = x + (z / (t / y))
else if (y <= (-1.4d-118)) then
tmp = x * (y / -t)
else if (y <= 1.9d+94) then
tmp = x + ((y * z) / t)
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 = y * ((z - x) / t);
double tmp;
if (y <= -8.4e+51) {
tmp = t_1;
} else if (y <= -4.5e-93) {
tmp = x + (z / (t / y));
} else if (y <= -1.4e-118) {
tmp = x * (y / -t);
} else if (y <= 1.9e+94) {
tmp = x + ((y * z) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * ((z - x) / t) tmp = 0 if y <= -8.4e+51: tmp = t_1 elif y <= -4.5e-93: tmp = x + (z / (t / y)) elif y <= -1.4e-118: tmp = x * (y / -t) elif y <= 1.9e+94: tmp = x + ((y * z) / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(Float64(z - x) / t)) tmp = 0.0 if (y <= -8.4e+51) tmp = t_1; elseif (y <= -4.5e-93) tmp = Float64(x + Float64(z / Float64(t / y))); elseif (y <= -1.4e-118) tmp = Float64(x * Float64(y / Float64(-t))); elseif (y <= 1.9e+94) tmp = Float64(x + Float64(Float64(y * z) / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * ((z - x) / t); tmp = 0.0; if (y <= -8.4e+51) tmp = t_1; elseif (y <= -4.5e-93) tmp = x + (z / (t / y)); elseif (y <= -1.4e-118) tmp = x * (y / -t); elseif (y <= 1.9e+94) tmp = x + ((y * z) / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.4e+51], t$95$1, If[LessEqual[y, -4.5e-93], N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.4e-118], N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+94], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - x}{t}\\
\mathbf{if}\;y \leq -8.4 \cdot 10^{+51}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{-93}:\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-118}:\\
\;\;\;\;x \cdot \frac{y}{-t}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+94}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -8.4000000000000005e51 or 1.8999999999999998e94 < y Initial program 76.2%
+-commutative76.2%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in y around inf 85.4%
Taylor expanded in z around 0 85.4%
mul-1-neg85.4%
sub-neg85.4%
div-sub85.4%
Simplified85.4%
if -8.4000000000000005e51 < y < -4.5000000000000002e-93Initial program 96.9%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in z around inf 86.1%
associate-*l/86.4%
*-commutative86.4%
Simplified86.4%
clear-num86.3%
div-inv86.4%
Applied egg-rr86.4%
if -4.5000000000000002e-93 < y < -1.4e-118Initial program 97.3%
+-commutative97.3%
associate-*r/62.2%
fma-def62.2%
Simplified62.2%
Taylor expanded in y around inf 62.2%
Taylor expanded in z around 0 62.2%
mul-1-neg62.2%
sub-neg62.2%
div-sub62.2%
Simplified62.2%
Taylor expanded in z around 0 97.3%
associate-*r/97.3%
associate-*l/97.6%
metadata-eval97.6%
associate-/r*97.6%
neg-mul-197.6%
*-commutative97.6%
*-commutative97.6%
associate-*l*100.0%
*-commutative100.0%
associate-*l/100.0%
*-lft-identity100.0%
Simplified100.0%
if -1.4e-118 < y < 1.8999999999999998e94Initial program 97.6%
associate-*l/98.5%
Simplified98.5%
Taylor expanded in z around inf 89.9%
Final simplification87.9%
(FPCore (x y z t)
:precision binary64
(if (or (<= z -2.2e+141)
(and (not (<= z -8.4e+101)) (or (<= z -8e+14) (not (<= z 1.4e-85)))))
(* y (/ z t))
x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.2e+141) || (!(z <= -8.4e+101) && ((z <= -8e+14) || !(z <= 1.4e-85)))) {
tmp = y * (z / t);
} else {
tmp = 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 <= (-2.2d+141)) .or. (.not. (z <= (-8.4d+101))) .and. (z <= (-8d+14)) .or. (.not. (z <= 1.4d-85))) then
tmp = y * (z / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.2e+141) || (!(z <= -8.4e+101) && ((z <= -8e+14) || !(z <= 1.4e-85)))) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.2e+141) or (not (z <= -8.4e+101) and ((z <= -8e+14) or not (z <= 1.4e-85))): tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.2e+141) || (!(z <= -8.4e+101) && ((z <= -8e+14) || !(z <= 1.4e-85)))) tmp = Float64(y * Float64(z / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.2e+141) || (~((z <= -8.4e+101)) && ((z <= -8e+14) || ~((z <= 1.4e-85))))) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.2e+141], And[N[Not[LessEqual[z, -8.4e+101]], $MachinePrecision], Or[LessEqual[z, -8e+14], N[Not[LessEqual[z, 1.4e-85]], $MachinePrecision]]]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+141} \lor \neg \left(z \leq -8.4 \cdot 10^{+101}\right) \land \left(z \leq -8 \cdot 10^{+14} \lor \neg \left(z \leq 1.4 \cdot 10^{-85}\right)\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.2e141 or -8.4000000000000001e101 < z < -8e14 or 1.40000000000000008e-85 < z Initial program 89.8%
+-commutative89.8%
associate-*r/90.7%
fma-def90.7%
Simplified90.7%
Taylor expanded in y around inf 69.6%
Taylor expanded in z around inf 65.5%
if -2.2e141 < z < -8.4000000000000001e101 or -8e14 < z < 1.40000000000000008e-85Initial program 89.2%
+-commutative89.2%
associate-*r/95.7%
fma-def95.7%
Simplified95.7%
Taylor expanded in y around 0 56.2%
Final simplification60.7%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.2e+141)
(* y (/ z t))
(if (<= z -8.5e+101)
x
(if (or (<= z -2.4e+16) (not (<= z 1.22e-85))) (/ z (/ t y)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e+141) {
tmp = y * (z / t);
} else if (z <= -8.5e+101) {
tmp = x;
} else if ((z <= -2.4e+16) || !(z <= 1.22e-85)) {
tmp = z / (t / y);
} else {
tmp = 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 <= (-2.2d+141)) then
tmp = y * (z / t)
else if (z <= (-8.5d+101)) then
tmp = x
else if ((z <= (-2.4d+16)) .or. (.not. (z <= 1.22d-85))) then
tmp = z / (t / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e+141) {
tmp = y * (z / t);
} else if (z <= -8.5e+101) {
tmp = x;
} else if ((z <= -2.4e+16) || !(z <= 1.22e-85)) {
tmp = z / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.2e+141: tmp = y * (z / t) elif z <= -8.5e+101: tmp = x elif (z <= -2.4e+16) or not (z <= 1.22e-85): tmp = z / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.2e+141) tmp = Float64(y * Float64(z / t)); elseif (z <= -8.5e+101) tmp = x; elseif ((z <= -2.4e+16) || !(z <= 1.22e-85)) tmp = Float64(z / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.2e+141) tmp = y * (z / t); elseif (z <= -8.5e+101) tmp = x; elseif ((z <= -2.4e+16) || ~((z <= 1.22e-85))) tmp = z / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.2e+141], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.5e+101], x, If[Or[LessEqual[z, -2.4e+16], N[Not[LessEqual[z, 1.22e-85]], $MachinePrecision]], N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+141}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{+101}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{+16} \lor \neg \left(z \leq 1.22 \cdot 10^{-85}\right):\\
\;\;\;\;\frac{z}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.2e141Initial program 92.5%
+-commutative92.5%
associate-*r/90.0%
fma-def90.0%
Simplified90.0%
Taylor expanded in y around inf 72.3%
Taylor expanded in z around inf 67.3%
if -2.2e141 < z < -8.5000000000000001e101 or -2.4e16 < z < 1.22000000000000006e-85Initial program 89.2%
+-commutative89.2%
associate-*r/95.7%
fma-def95.7%
Simplified95.7%
Taylor expanded in y around 0 56.2%
if -8.5000000000000001e101 < z < -2.4e16 or 1.22000000000000006e-85 < z Initial program 88.6%
+-commutative88.6%
associate-*r/91.0%
fma-def91.0%
Simplified91.0%
Taylor expanded in y around inf 68.3%
Taylor expanded in z around inf 64.7%
*-commutative64.7%
associate-/r/69.3%
Applied egg-rr69.3%
Final simplification62.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (/ z t))))
(if (<= z -2.2e+141)
t_1
(if (<= z -1.35e+100)
x
(if (<= z -3.9e+14) (/ y (/ t z)) (if (<= z 1.4e-85) x t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (z / t);
double tmp;
if (z <= -2.2e+141) {
tmp = t_1;
} else if (z <= -1.35e+100) {
tmp = x;
} else if (z <= -3.9e+14) {
tmp = y / (t / z);
} else if (z <= 1.4e-85) {
tmp = x;
} 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 = y * (z / t)
if (z <= (-2.2d+141)) then
tmp = t_1
else if (z <= (-1.35d+100)) then
tmp = x
else if (z <= (-3.9d+14)) then
tmp = y / (t / z)
else if (z <= 1.4d-85) then
tmp = x
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 = y * (z / t);
double tmp;
if (z <= -2.2e+141) {
tmp = t_1;
} else if (z <= -1.35e+100) {
tmp = x;
} else if (z <= -3.9e+14) {
tmp = y / (t / z);
} else if (z <= 1.4e-85) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (z / t) tmp = 0 if z <= -2.2e+141: tmp = t_1 elif z <= -1.35e+100: tmp = x elif z <= -3.9e+14: tmp = y / (t / z) elif z <= 1.4e-85: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(z / t)) tmp = 0.0 if (z <= -2.2e+141) tmp = t_1; elseif (z <= -1.35e+100) tmp = x; elseif (z <= -3.9e+14) tmp = Float64(y / Float64(t / z)); elseif (z <= 1.4e-85) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (z / t); tmp = 0.0; if (z <= -2.2e+141) tmp = t_1; elseif (z <= -1.35e+100) tmp = x; elseif (z <= -3.9e+14) tmp = y / (t / z); elseif (z <= 1.4e-85) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+141], t$95$1, If[LessEqual[z, -1.35e+100], x, If[LessEqual[z, -3.9e+14], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-85], x, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{t}\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+141}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{+100}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{+14}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-85}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.2e141 or 1.40000000000000008e-85 < z Initial program 88.3%
+-commutative88.3%
associate-*r/92.0%
fma-def92.0%
Simplified92.0%
Taylor expanded in y around inf 69.6%
Taylor expanded in z around inf 64.9%
if -2.2e141 < z < -1.34999999999999999e100 or -3.9e14 < z < 1.40000000000000008e-85Initial program 89.2%
+-commutative89.2%
associate-*r/95.7%
fma-def95.7%
Simplified95.7%
Taylor expanded in y around 0 56.2%
if -1.34999999999999999e100 < z < -3.9e14Initial program 99.6%
+-commutative99.6%
associate-*r/81.9%
fma-def81.9%
Simplified81.9%
Taylor expanded in y around inf 69.5%
Taylor expanded in z around inf 70.0%
clear-num69.9%
un-div-inv72.3%
Applied egg-rr72.3%
Final simplification60.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -8.5e-175) (not (<= y 1.6e+58))) (* y (/ (- z x) t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8.5e-175) || !(y <= 1.6e+58)) {
tmp = y * ((z - x) / t);
} else {
tmp = 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 ((y <= (-8.5d-175)) .or. (.not. (y <= 1.6d+58))) then
tmp = y * ((z - x) / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8.5e-175) || !(y <= 1.6e+58)) {
tmp = y * ((z - x) / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -8.5e-175) or not (y <= 1.6e+58): tmp = y * ((z - x) / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -8.5e-175) || !(y <= 1.6e+58)) tmp = Float64(y * Float64(Float64(z - x) / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -8.5e-175) || ~((y <= 1.6e+58))) tmp = y * ((z - x) / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -8.5e-175], N[Not[LessEqual[y, 1.6e+58]], $MachinePrecision]], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{-175} \lor \neg \left(y \leq 1.6 \cdot 10^{+58}\right):\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -8.5000000000000005e-175 or 1.60000000000000008e58 < y Initial program 84.0%
+-commutative84.0%
associate-*r/96.3%
fma-def96.3%
Simplified96.3%
Taylor expanded in y around inf 75.0%
Taylor expanded in z around 0 75.0%
mul-1-neg75.0%
sub-neg75.0%
div-sub75.6%
Simplified75.6%
if -8.5000000000000005e-175 < y < 1.60000000000000008e58Initial program 98.1%
+-commutative98.1%
associate-*r/88.5%
fma-def88.5%
Simplified88.5%
Taylor expanded in y around 0 68.3%
Final simplification72.8%
(FPCore (x y z t) :precision binary64 (if (<= z -3.75e-53) (+ x (* z (/ y t))) (if (<= z 4.2e-44) (- x (* x (/ y t))) (+ x (/ z (/ t y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.75e-53) {
tmp = x + (z * (y / t));
} else if (z <= 4.2e-44) {
tmp = x - (x * (y / t));
} else {
tmp = x + (z / (t / y));
}
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 <= (-3.75d-53)) then
tmp = x + (z * (y / t))
else if (z <= 4.2d-44) then
tmp = x - (x * (y / t))
else
tmp = x + (z / (t / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.75e-53) {
tmp = x + (z * (y / t));
} else if (z <= 4.2e-44) {
tmp = x - (x * (y / t));
} else {
tmp = x + (z / (t / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.75e-53: tmp = x + (z * (y / t)) elif z <= 4.2e-44: tmp = x - (x * (y / t)) else: tmp = x + (z / (t / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.75e-53) tmp = Float64(x + Float64(z * Float64(y / t))); elseif (z <= 4.2e-44) tmp = Float64(x - Float64(x * Float64(y / t))); else tmp = Float64(x + Float64(z / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.75e-53) tmp = x + (z * (y / t)); elseif (z <= 4.2e-44) tmp = x - (x * (y / t)); else tmp = x + (z / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.75e-53], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e-44], N[(x - N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.75 \cdot 10^{-53}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-44}:\\
\;\;\;\;x - x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -3.75e-53Initial program 91.8%
associate-*l/96.7%
Simplified96.7%
Taylor expanded in z around inf 90.6%
associate-*l/91.0%
*-commutative91.0%
Simplified91.0%
if -3.75e-53 < z < 4.20000000000000003e-44Initial program 89.1%
+-commutative89.1%
associate-*r/95.0%
fma-def95.0%
Simplified95.0%
Taylor expanded in z around 0 79.4%
+-commutative79.4%
mul-1-neg79.4%
unsub-neg79.4%
*-commutative79.4%
associate-*r/89.2%
Simplified89.2%
if 4.20000000000000003e-44 < z Initial program 87.0%
associate-*l/98.2%
Simplified98.2%
Taylor expanded in z around inf 84.8%
associate-*l/94.4%
*-commutative94.4%
Simplified94.4%
clear-num94.5%
div-inv94.5%
Applied egg-rr94.5%
Final simplification91.0%
(FPCore (x y z t) :precision binary64 (+ x (* (- z x) (/ y t))))
double code(double x, double y, double z, double t) {
return x + ((z - x) * (y / t));
}
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 + ((z - x) * (y / t))
end function
public static double code(double x, double y, double z, double t) {
return x + ((z - x) * (y / t));
}
def code(x, y, z, t): return x + ((z - x) * (y / t))
function code(x, y, z, t) return Float64(x + Float64(Float64(z - x) * Float64(y / t))) end
function tmp = code(x, y, z, t) tmp = x + ((z - x) * (y / t)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - x\right) \cdot \frac{y}{t}
\end{array}
Initial program 89.5%
associate-*l/96.7%
Simplified96.7%
Final simplification96.7%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return 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 = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 89.5%
+-commutative89.5%
associate-*r/93.3%
fma-def93.3%
Simplified93.3%
Taylor expanded in y around 0 40.8%
Final simplification40.8%
(FPCore (x y z t) :precision binary64 (- x (+ (* x (/ y t)) (* (- z) (/ y t)))))
double code(double x, double y, double z, double t) {
return x - ((x * (y / t)) + (-z * (y / t)));
}
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 - ((x * (y / t)) + (-z * (y / t)))
end function
public static double code(double x, double y, double z, double t) {
return x - ((x * (y / t)) + (-z * (y / t)));
}
def code(x, y, z, t): return x - ((x * (y / t)) + (-z * (y / t)))
function code(x, y, z, t) return Float64(x - Float64(Float64(x * Float64(y / t)) + Float64(Float64(-z) * Float64(y / t)))) end
function tmp = code(x, y, z, t) tmp = x - ((x * (y / t)) + (-z * (y / t))); end
code[x_, y_, z_, t_] := N[(x - N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] + N[((-z) * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)
\end{array}
herbie shell --seed 2023257
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:herbie-target
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))