
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - 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 - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - 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 - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= x -5.9e-120) (/ (- y z) (/ (- t z) x)) (if (<= x 9.2e-20) (/ (* x (- y z)) (- t z)) (* (- y z) (/ x (- t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.9e-120) {
tmp = (y - z) / ((t - z) / x);
} else if (x <= 9.2e-20) {
tmp = (x * (y - z)) / (t - z);
} else {
tmp = (y - z) * (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 (x <= (-5.9d-120)) then
tmp = (y - z) / ((t - z) / x)
else if (x <= 9.2d-20) then
tmp = (x * (y - z)) / (t - z)
else
tmp = (y - z) * (x / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.9e-120) {
tmp = (y - z) / ((t - z) / x);
} else if (x <= 9.2e-20) {
tmp = (x * (y - z)) / (t - z);
} else {
tmp = (y - z) * (x / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.9e-120: tmp = (y - z) / ((t - z) / x) elif x <= 9.2e-20: tmp = (x * (y - z)) / (t - z) else: tmp = (y - z) * (x / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.9e-120) tmp = Float64(Float64(y - z) / Float64(Float64(t - z) / x)); elseif (x <= 9.2e-20) tmp = Float64(Float64(x * Float64(y - z)) / Float64(t - z)); else tmp = Float64(Float64(y - z) * Float64(x / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -5.9e-120) tmp = (y - z) / ((t - z) / x); elseif (x <= 9.2e-20) tmp = (x * (y - z)) / (t - z); else tmp = (y - z) * (x / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.9e-120], N[(N[(y - z), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.2e-20], N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.9 \cdot 10^{-120}:\\
\;\;\;\;\frac{y - z}{\frac{t - z}{x}}\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-20}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\end{array}
\end{array}
if x < -5.89999999999999979e-120Initial program 80.8%
associate-*l/96.7%
Simplified96.7%
*-commutative96.7%
clear-num96.7%
un-div-inv97.1%
Applied egg-rr97.1%
if -5.89999999999999979e-120 < x < 9.1999999999999997e-20Initial program 95.8%
if 9.1999999999999997e-20 < x Initial program 71.7%
associate-*l/98.4%
Simplified98.4%
Final simplification96.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -4.4e+17)
x
(if (<= z 1.15e-84)
(* y (/ x (- t z)))
(if (<= z 9.5e+156) (* z (/ x (- z t))) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.4e+17) {
tmp = x;
} else if (z <= 1.15e-84) {
tmp = y * (x / (t - z));
} else if (z <= 9.5e+156) {
tmp = z * (x / (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 <= (-4.4d+17)) then
tmp = x
else if (z <= 1.15d-84) then
tmp = y * (x / (t - z))
else if (z <= 9.5d+156) then
tmp = z * (x / (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 <= -4.4e+17) {
tmp = x;
} else if (z <= 1.15e-84) {
tmp = y * (x / (t - z));
} else if (z <= 9.5e+156) {
tmp = z * (x / (z - t));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.4e+17: tmp = x elif z <= 1.15e-84: tmp = y * (x / (t - z)) elif z <= 9.5e+156: tmp = z * (x / (z - t)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.4e+17) tmp = x; elseif (z <= 1.15e-84) tmp = Float64(y * Float64(x / Float64(t - z))); elseif (z <= 9.5e+156) tmp = Float64(z * Float64(x / Float64(z - t))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.4e+17) tmp = x; elseif (z <= 1.15e-84) tmp = y * (x / (t - z)); elseif (z <= 9.5e+156) tmp = z * (x / (z - t)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.4e+17], x, If[LessEqual[z, 1.15e-84], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+156], N[(z * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+17}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-84}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+156}:\\
\;\;\;\;z \cdot \frac{x}{z - t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.4e17 or 9.5000000000000002e156 < z Initial program 72.5%
associate-*l/66.4%
Simplified66.4%
Taylor expanded in z around inf 66.5%
if -4.4e17 < z < 1.1499999999999999e-84Initial program 92.1%
associate-*l/93.6%
Simplified93.6%
Taylor expanded in y around inf 80.0%
associate-*l/81.4%
*-commutative81.4%
Simplified81.4%
if 1.1499999999999999e-84 < z < 9.5000000000000002e156Initial program 83.2%
associate-*l/87.4%
Simplified87.4%
Taylor expanded in y around 0 50.9%
associate-*r/50.9%
mul-1-neg50.9%
distribute-rgt-neg-out50.9%
associate-/l*63.0%
Simplified63.0%
frac-2neg63.0%
remove-double-neg63.0%
associate-/r/56.3%
sub-neg56.3%
distribute-neg-in56.3%
remove-double-neg56.3%
Applied egg-rr56.3%
*-commutative56.3%
+-commutative56.3%
unsub-neg56.3%
Simplified56.3%
Final simplification71.5%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.32e+163)
x
(if (<= z 8e+19)
(* x (/ y (- t z)))
(if (<= z 9.5e+156) (* z (/ x (- z t))) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.32e+163) {
tmp = x;
} else if (z <= 8e+19) {
tmp = x * (y / (t - z));
} else if (z <= 9.5e+156) {
tmp = z * (x / (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 <= (-1.32d+163)) then
tmp = x
else if (z <= 8d+19) then
tmp = x * (y / (t - z))
else if (z <= 9.5d+156) then
tmp = z * (x / (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 <= -1.32e+163) {
tmp = x;
} else if (z <= 8e+19) {
tmp = x * (y / (t - z));
} else if (z <= 9.5e+156) {
tmp = z * (x / (z - t));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.32e+163: tmp = x elif z <= 8e+19: tmp = x * (y / (t - z)) elif z <= 9.5e+156: tmp = z * (x / (z - t)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.32e+163) tmp = x; elseif (z <= 8e+19) tmp = Float64(x * Float64(y / Float64(t - z))); elseif (z <= 9.5e+156) tmp = Float64(z * Float64(x / Float64(z - t))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.32e+163) tmp = x; elseif (z <= 8e+19) tmp = x * (y / (t - z)); elseif (z <= 9.5e+156) tmp = z * (x / (z - t)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.32e+163], x, If[LessEqual[z, 8e+19], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+156], N[(z * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.32 \cdot 10^{+163}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+19}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+156}:\\
\;\;\;\;z \cdot \frac{x}{z - t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.31999999999999995e163 or 9.5000000000000002e156 < z Initial program 66.0%
associate-*l/65.8%
Simplified65.8%
Taylor expanded in z around inf 80.1%
if -1.31999999999999995e163 < z < 8e19Initial program 92.1%
associate-*l/89.0%
Simplified89.0%
Taylor expanded in y around inf 70.1%
*-commutative70.1%
associate-/l*69.5%
associate-/r/72.7%
Simplified72.7%
if 8e19 < z < 9.5000000000000002e156Initial program 70.0%
associate-*l/86.6%
Simplified86.6%
Taylor expanded in y around 0 48.5%
associate-*r/48.5%
mul-1-neg48.5%
distribute-rgt-neg-out48.5%
associate-/l*70.2%
Simplified70.2%
frac-2neg70.2%
remove-double-neg70.2%
associate-/r/61.2%
sub-neg61.2%
distribute-neg-in61.2%
remove-double-neg61.2%
Applied egg-rr61.2%
*-commutative61.2%
+-commutative61.2%
unsub-neg61.2%
Simplified61.2%
Final simplification72.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.9e+139) (not (<= z 1.35e+156))) (/ (- x) (/ z (- y z))) (* (- y z) (/ x (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.9e+139) || !(z <= 1.35e+156)) {
tmp = -x / (z / (y - z));
} else {
tmp = (y - z) * (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 ((z <= (-2.9d+139)) .or. (.not. (z <= 1.35d+156))) then
tmp = -x / (z / (y - z))
else
tmp = (y - z) * (x / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.9e+139) || !(z <= 1.35e+156)) {
tmp = -x / (z / (y - z));
} else {
tmp = (y - z) * (x / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.9e+139) or not (z <= 1.35e+156): tmp = -x / (z / (y - z)) else: tmp = (y - z) * (x / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.9e+139) || !(z <= 1.35e+156)) tmp = Float64(Float64(-x) / Float64(z / Float64(y - z))); else tmp = Float64(Float64(y - z) * Float64(x / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.9e+139) || ~((z <= 1.35e+156))) tmp = -x / (z / (y - z)); else tmp = (y - z) * (x / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.9e+139], N[Not[LessEqual[z, 1.35e+156]], $MachinePrecision]], N[((-x) / N[(z / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+139} \lor \neg \left(z \leq 1.35 \cdot 10^{+156}\right):\\
\;\;\;\;\frac{-x}{\frac{z}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\end{array}
\end{array}
if z < -2.8999999999999999e139 or 1.35e156 < z Initial program 67.3%
associate-*l/62.0%
Simplified62.0%
Taylor expanded in t around 0 62.9%
mul-1-neg62.9%
associate-/l*93.8%
distribute-neg-frac93.8%
Simplified93.8%
if -2.8999999999999999e139 < z < 1.35e156Initial program 89.0%
associate-*l/90.2%
Simplified90.2%
Final simplification91.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -6e-120) (not (<= x 3e-20))) (* (- y z) (/ x (- t z))) (/ (* x (- y z)) (- t z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6e-120) || !(x <= 3e-20)) {
tmp = (y - z) * (x / (t - z));
} else {
tmp = (x * (y - z)) / (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 ((x <= (-6d-120)) .or. (.not. (x <= 3d-20))) then
tmp = (y - z) * (x / (t - z))
else
tmp = (x * (y - z)) / (t - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6e-120) || !(x <= 3e-20)) {
tmp = (y - z) * (x / (t - z));
} else {
tmp = (x * (y - z)) / (t - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -6e-120) or not (x <= 3e-20): tmp = (y - z) * (x / (t - z)) else: tmp = (x * (y - z)) / (t - z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -6e-120) || !(x <= 3e-20)) tmp = Float64(Float64(y - z) * Float64(x / Float64(t - z))); else tmp = Float64(Float64(x * Float64(y - z)) / Float64(t - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -6e-120) || ~((x <= 3e-20))) tmp = (y - z) * (x / (t - z)); else tmp = (x * (y - z)) / (t - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -6e-120], N[Not[LessEqual[x, 3e-20]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{-120} \lor \neg \left(x \leq 3 \cdot 10^{-20}\right):\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\
\end{array}
\end{array}
if x < -6.00000000000000022e-120 or 3.00000000000000029e-20 < x Initial program 77.2%
associate-*l/97.4%
Simplified97.4%
if -6.00000000000000022e-120 < x < 3.00000000000000029e-20Initial program 95.8%
Final simplification96.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.85e-38) (not (<= z 2.9e+20))) (/ (- x) (/ z (- y z))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.85e-38) || !(z <= 2.9e+20)) {
tmp = -x / (z / (y - z));
} else {
tmp = x * (y / (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 ((z <= (-1.85d-38)) .or. (.not. (z <= 2.9d+20))) then
tmp = -x / (z / (y - z))
else
tmp = x * (y / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.85e-38) || !(z <= 2.9e+20)) {
tmp = -x / (z / (y - z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.85e-38) or not (z <= 2.9e+20): tmp = -x / (z / (y - z)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.85e-38) || !(z <= 2.9e+20)) tmp = Float64(Float64(-x) / Float64(z / Float64(y - z))); else tmp = Float64(x * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.85e-38) || ~((z <= 2.9e+20))) tmp = -x / (z / (y - z)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.85e-38], N[Not[LessEqual[z, 2.9e+20]], $MachinePrecision]], N[((-x) / N[(z / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-38} \lor \neg \left(z \leq 2.9 \cdot 10^{+20}\right):\\
\;\;\;\;\frac{-x}{\frac{z}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -1.85e-38 or 2.9e20 < z Initial program 75.8%
associate-*l/75.4%
Simplified75.4%
Taylor expanded in t around 0 60.5%
mul-1-neg60.5%
associate-/l*79.2%
distribute-neg-frac79.2%
Simplified79.2%
if -1.85e-38 < z < 2.9e20Initial program 92.0%
associate-*l/92.0%
Simplified92.0%
Taylor expanded in y around inf 77.3%
*-commutative77.3%
associate-/l*77.2%
associate-/r/79.3%
Simplified79.3%
Final simplification79.2%
(FPCore (x y z t) :precision binary64 (if (<= z -2.7e+22) x (if (<= z -6.5e-46) (* y (/ (- x) z)) (if (<= z 3.5e+20) (/ x (/ t y)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.7e+22) {
tmp = x;
} else if (z <= -6.5e-46) {
tmp = y * (-x / z);
} else if (z <= 3.5e+20) {
tmp = x / (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.7d+22)) then
tmp = x
else if (z <= (-6.5d-46)) then
tmp = y * (-x / z)
else if (z <= 3.5d+20) then
tmp = x / (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.7e+22) {
tmp = x;
} else if (z <= -6.5e-46) {
tmp = y * (-x / z);
} else if (z <= 3.5e+20) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.7e+22: tmp = x elif z <= -6.5e-46: tmp = y * (-x / z) elif z <= 3.5e+20: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.7e+22) tmp = x; elseif (z <= -6.5e-46) tmp = Float64(y * Float64(Float64(-x) / z)); elseif (z <= 3.5e+20) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.7e+22) tmp = x; elseif (z <= -6.5e-46) tmp = y * (-x / z); elseif (z <= 3.5e+20) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.7e+22], x, If[LessEqual[z, -6.5e-46], N[(y * N[((-x) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e+20], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+22}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-46}:\\
\;\;\;\;y \cdot \frac{-x}{z}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+20}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.7000000000000002e22 or 3.5e20 < z Initial program 72.4%
associate-*l/72.0%
Simplified72.0%
Taylor expanded in z around inf 60.1%
if -2.7000000000000002e22 < z < -6.49999999999999966e-46Initial program 99.8%
associate-*l/99.5%
Simplified99.5%
Taylor expanded in y around inf 66.3%
associate-*l/66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in t around 0 62.9%
associate-*r/62.9%
neg-mul-162.9%
Simplified62.9%
if -6.49999999999999966e-46 < z < 3.5e20Initial program 91.9%
associate-*l/91.9%
Simplified91.9%
Taylor expanded in z around 0 64.3%
associate-/l*67.1%
Simplified67.1%
Final simplification63.9%
(FPCore (x y z t) :precision binary64 (if (<= z -1.26e+14) x (if (<= z -4.2e-45) (* (- x) (/ y z)) (if (<= z 3.4e+20) (/ x (/ t y)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.26e+14) {
tmp = x;
} else if (z <= -4.2e-45) {
tmp = -x * (y / z);
} else if (z <= 3.4e+20) {
tmp = x / (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 <= (-1.26d+14)) then
tmp = x
else if (z <= (-4.2d-45)) then
tmp = -x * (y / z)
else if (z <= 3.4d+20) then
tmp = x / (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 <= -1.26e+14) {
tmp = x;
} else if (z <= -4.2e-45) {
tmp = -x * (y / z);
} else if (z <= 3.4e+20) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.26e+14: tmp = x elif z <= -4.2e-45: tmp = -x * (y / z) elif z <= 3.4e+20: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.26e+14) tmp = x; elseif (z <= -4.2e-45) tmp = Float64(Float64(-x) * Float64(y / z)); elseif (z <= 3.4e+20) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.26e+14) tmp = x; elseif (z <= -4.2e-45) tmp = -x * (y / z); elseif (z <= 3.4e+20) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.26e+14], x, If[LessEqual[z, -4.2e-45], N[((-x) * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e+20], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.26 \cdot 10^{+14}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-45}:\\
\;\;\;\;\left(-x\right) \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+20}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.26e14 or 3.4e20 < z Initial program 72.4%
associate-*l/72.0%
Simplified72.0%
Taylor expanded in z around inf 60.1%
if -1.26e14 < z < -4.1999999999999999e-45Initial program 99.8%
associate-*l/99.5%
Simplified99.5%
Taylor expanded in y around inf 66.3%
associate-*l/66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in t around 0 63.1%
mul-1-neg63.1%
associate-/l*63.2%
distribute-neg-frac63.2%
Simplified63.2%
Taylor expanded in x around 0 63.1%
associate-*r/63.1%
associate-*r*63.1%
*-commutative63.1%
associate-*r*63.1%
*-commutative63.1%
mul-1-neg63.1%
Simplified63.1%
if -4.1999999999999999e-45 < z < 3.4e20Initial program 91.9%
associate-*l/91.9%
Simplified91.9%
Taylor expanded in z around 0 64.3%
associate-/l*67.1%
Simplified67.1%
Final simplification63.9%
(FPCore (x y z t) :precision binary64 (if (<= z -10600000000000.0) x (if (<= z -3.2e-45) (/ (- x) (/ z y)) (if (<= z 3.8e+20) (/ x (/ t y)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -10600000000000.0) {
tmp = x;
} else if (z <= -3.2e-45) {
tmp = -x / (z / y);
} else if (z <= 3.8e+20) {
tmp = x / (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 <= (-10600000000000.0d0)) then
tmp = x
else if (z <= (-3.2d-45)) then
tmp = -x / (z / y)
else if (z <= 3.8d+20) then
tmp = x / (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 <= -10600000000000.0) {
tmp = x;
} else if (z <= -3.2e-45) {
tmp = -x / (z / y);
} else if (z <= 3.8e+20) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -10600000000000.0: tmp = x elif z <= -3.2e-45: tmp = -x / (z / y) elif z <= 3.8e+20: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -10600000000000.0) tmp = x; elseif (z <= -3.2e-45) tmp = Float64(Float64(-x) / Float64(z / y)); elseif (z <= 3.8e+20) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -10600000000000.0) tmp = x; elseif (z <= -3.2e-45) tmp = -x / (z / y); elseif (z <= 3.8e+20) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -10600000000000.0], x, If[LessEqual[z, -3.2e-45], N[((-x) / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+20], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -10600000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-45}:\\
\;\;\;\;\frac{-x}{\frac{z}{y}}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+20}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.06e13 or 3.8e20 < z Initial program 72.4%
associate-*l/72.0%
Simplified72.0%
Taylor expanded in z around inf 60.1%
if -1.06e13 < z < -3.20000000000000007e-45Initial program 99.8%
associate-*l/99.5%
Simplified99.5%
Taylor expanded in y around inf 66.3%
associate-*l/66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in t around 0 63.1%
mul-1-neg63.1%
associate-/l*63.2%
distribute-neg-frac63.2%
Simplified63.2%
if -3.20000000000000007e-45 < z < 3.8e20Initial program 91.9%
associate-*l/91.9%
Simplified91.9%
Taylor expanded in z around 0 64.3%
associate-/l*67.1%
Simplified67.1%
Final simplification63.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.4e-38) (not (<= z 3e+20))) (- x (* y (/ x z))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.4e-38) || !(z <= 3e+20)) {
tmp = x - (y * (x / z));
} else {
tmp = x * (y / (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 ((z <= (-1.4d-38)) .or. (.not. (z <= 3d+20))) then
tmp = x - (y * (x / z))
else
tmp = x * (y / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.4e-38) || !(z <= 3e+20)) {
tmp = x - (y * (x / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.4e-38) or not (z <= 3e+20): tmp = x - (y * (x / z)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.4e-38) || !(z <= 3e+20)) tmp = Float64(x - Float64(y * Float64(x / z))); else tmp = Float64(x * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.4e-38) || ~((z <= 3e+20))) tmp = x - (y * (x / z)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.4e-38], N[Not[LessEqual[z, 3e+20]], $MachinePrecision]], N[(x - N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{-38} \lor \neg \left(z \leq 3 \cdot 10^{+20}\right):\\
\;\;\;\;x - y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -1.4e-38 or 3e20 < z Initial program 75.8%
associate-*l/75.4%
Simplified75.4%
Taylor expanded in t around 0 58.2%
associate-*r/22.5%
neg-mul-122.5%
Simplified58.2%
Taylor expanded in z around 0 72.8%
mul-1-neg72.8%
unsub-neg72.8%
associate-*l/74.2%
*-commutative74.2%
Simplified74.2%
if -1.4e-38 < z < 3e20Initial program 92.0%
associate-*l/92.0%
Simplified92.0%
Taylor expanded in y around inf 77.3%
*-commutative77.3%
associate-/l*77.2%
associate-/r/79.3%
Simplified79.3%
Final simplification76.9%
(FPCore (x y z t) :precision binary64 (if (<= z -6.5e+21) x (if (<= z 5.5e+31) (* y (/ x (- t z))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.5e+21) {
tmp = x;
} else if (z <= 5.5e+31) {
tmp = y * (x / (t - z));
} 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 <= (-6.5d+21)) then
tmp = x
else if (z <= 5.5d+31) then
tmp = y * (x / (t - z))
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 <= -6.5e+21) {
tmp = x;
} else if (z <= 5.5e+31) {
tmp = y * (x / (t - z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.5e+21: tmp = x elif z <= 5.5e+31: tmp = y * (x / (t - z)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.5e+21) tmp = x; elseif (z <= 5.5e+31) tmp = Float64(y * Float64(x / Float64(t - z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6.5e+21) tmp = x; elseif (z <= 5.5e+31) tmp = y * (x / (t - z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.5e+21], x, If[LessEqual[z, 5.5e+31], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+21}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+31}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.5e21 or 5.50000000000000002e31 < z Initial program 71.4%
associate-*l/71.8%
Simplified71.8%
Taylor expanded in z around inf 61.2%
if -6.5e21 < z < 5.50000000000000002e31Initial program 93.0%
associate-*l/92.4%
Simplified92.4%
Taylor expanded in y around inf 74.9%
associate-*l/74.8%
*-commutative74.8%
Simplified74.8%
Final simplification69.4%
(FPCore (x y z t) :precision binary64 (if (<= z -2e-38) (- x (* y (/ x z))) (if (<= z 3.6e+19) (* x (/ y (- t z))) (/ x (/ (- z t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e-38) {
tmp = x - (y * (x / z));
} else if (z <= 3.6e+19) {
tmp = x * (y / (t - z));
} else {
tmp = x / ((z - 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 (z <= (-2d-38)) then
tmp = x - (y * (x / z))
else if (z <= 3.6d+19) then
tmp = x * (y / (t - z))
else
tmp = x / ((z - t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e-38) {
tmp = x - (y * (x / z));
} else if (z <= 3.6e+19) {
tmp = x * (y / (t - z));
} else {
tmp = x / ((z - t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2e-38: tmp = x - (y * (x / z)) elif z <= 3.6e+19: tmp = x * (y / (t - z)) else: tmp = x / ((z - t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2e-38) tmp = Float64(x - Float64(y * Float64(x / z))); elseif (z <= 3.6e+19) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = Float64(x / Float64(Float64(z - t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2e-38) tmp = x - (y * (x / z)); elseif (z <= 3.6e+19) tmp = x * (y / (t - z)); else tmp = x / ((z - t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2e-38], N[(x - N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+19], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-38}:\\
\;\;\;\;x - y \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+19}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z - t}{z}}\\
\end{array}
\end{array}
if z < -1.9999999999999999e-38Initial program 78.8%
associate-*l/75.9%
Simplified75.9%
Taylor expanded in t around 0 60.4%
associate-*r/25.9%
neg-mul-125.9%
Simplified60.4%
Taylor expanded in z around 0 75.8%
mul-1-neg75.8%
unsub-neg75.8%
associate-*l/76.0%
*-commutative76.0%
Simplified76.0%
if -1.9999999999999999e-38 < z < 3.6e19Initial program 92.6%
associate-*l/92.0%
Simplified92.0%
Taylor expanded in y around inf 77.8%
*-commutative77.8%
associate-/l*77.8%
associate-/r/79.8%
Simplified79.8%
if 3.6e19 < z Initial program 70.9%
associate-*l/75.3%
Simplified75.3%
Taylor expanded in y around 0 53.5%
associate-*r/53.5%
mul-1-neg53.5%
distribute-rgt-neg-out53.5%
associate-/l*74.6%
Simplified74.6%
frac-2neg74.6%
div-inv74.4%
sub-neg74.4%
distribute-neg-in74.4%
remove-double-neg74.4%
remove-double-neg74.4%
Applied egg-rr74.4%
associate-*r/74.6%
*-rgt-identity74.6%
+-commutative74.6%
unsub-neg74.6%
Simplified74.6%
Final simplification77.7%
(FPCore (x y z t) :precision binary64 (if (<= z -1.4e-38) x (if (<= z 2.35e+20) (* y (/ x t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.4e-38) {
tmp = x;
} else if (z <= 2.35e+20) {
tmp = y * (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 (z <= (-1.4d-38)) then
tmp = x
else if (z <= 2.35d+20) then
tmp = y * (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 (z <= -1.4e-38) {
tmp = x;
} else if (z <= 2.35e+20) {
tmp = y * (x / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.4e-38: tmp = x elif z <= 2.35e+20: tmp = y * (x / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.4e-38) tmp = x; elseif (z <= 2.35e+20) tmp = Float64(y * Float64(x / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.4e-38) tmp = x; elseif (z <= 2.35e+20) tmp = y * (x / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.4e-38], x, If[LessEqual[z, 2.35e+20], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{-38}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{+20}:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.4e-38 or 2.35e20 < z Initial program 75.8%
associate-*l/75.4%
Simplified75.4%
Taylor expanded in z around inf 55.5%
if -1.4e-38 < z < 2.35e20Initial program 92.0%
associate-*l/92.0%
Simplified92.0%
Taylor expanded in z around 0 64.1%
associate-/l*66.8%
associate-/r/63.3%
Simplified63.3%
Final simplification59.6%
(FPCore (x y z t) :precision binary64 (if (<= z -2.02e-38) x (if (<= z 3.2e+20) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.02e-38) {
tmp = x;
} else if (z <= 3.2e+20) {
tmp = x * (y / 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.02d-38)) then
tmp = x
else if (z <= 3.2d+20) then
tmp = x * (y / 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.02e-38) {
tmp = x;
} else if (z <= 3.2e+20) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.02e-38: tmp = x elif z <= 3.2e+20: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.02e-38) tmp = x; elseif (z <= 3.2e+20) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.02e-38) tmp = x; elseif (z <= 3.2e+20) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.02e-38], x, If[LessEqual[z, 3.2e+20], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.02 \cdot 10^{-38}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+20}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.02000000000000007e-38 or 3.2e20 < z Initial program 75.8%
associate-*l/75.4%
Simplified75.4%
Taylor expanded in z around inf 55.5%
if -2.02000000000000007e-38 < z < 3.2e20Initial program 92.0%
associate-*l/92.0%
Simplified92.0%
*-commutative92.0%
clear-num92.0%
un-div-inv92.3%
Applied egg-rr92.3%
Taylor expanded in z around 0 64.1%
*-commutative64.1%
associate-*l/66.8%
Simplified66.8%
Final simplification61.4%
(FPCore (x y z t) :precision binary64 (if (<= z -2.02e-38) x (if (<= z 3.3e+20) (/ x (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.02e-38) {
tmp = x;
} else if (z <= 3.3e+20) {
tmp = x / (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.02d-38)) then
tmp = x
else if (z <= 3.3d+20) then
tmp = x / (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.02e-38) {
tmp = x;
} else if (z <= 3.3e+20) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.02e-38: tmp = x elif z <= 3.3e+20: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.02e-38) tmp = x; elseif (z <= 3.3e+20) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.02e-38) tmp = x; elseif (z <= 3.3e+20) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.02e-38], x, If[LessEqual[z, 3.3e+20], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.02 \cdot 10^{-38}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+20}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.02000000000000007e-38 or 3.3e20 < z Initial program 75.8%
associate-*l/75.4%
Simplified75.4%
Taylor expanded in z around inf 55.5%
if -2.02000000000000007e-38 < z < 3.3e20Initial program 92.0%
associate-*l/92.0%
Simplified92.0%
Taylor expanded in z around 0 64.1%
associate-/l*66.8%
Simplified66.8%
Final simplification61.5%
(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 84.3%
associate-*l/84.2%
Simplified84.2%
Taylor expanded in z around inf 32.3%
Final simplification32.3%
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - 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 / ((t - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
def code(x, y, z, t): return x / ((t - z) / (y - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(t - z) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) / (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
herbie shell --seed 2023290
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:herbie-target
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))