
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (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 - y) / (z - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (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 - y) / (z - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
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 / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
Initial program 96.4%
associate-*l/82.8%
associate-*r/83.2%
Simplified83.2%
associate-*r/82.8%
associate-*l/96.4%
*-commutative96.4%
clear-num96.4%
un-div-inv96.9%
Applied egg-rr96.9%
Final simplification96.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ y (- y z)))) (t_2 (* t (/ x (- z y)))))
(if (<= x -1.55e+81)
t_2
(if (<= x -4.8e-48)
t_1
(if (<= x -8.5e-94)
(* x (/ t (- z y)))
(if (or (<= x 1.12e-101) (and (not (<= x 6.2e-15)) (<= x 5.1e+29)))
t_1
t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (y / (y - z));
double t_2 = t * (x / (z - y));
double tmp;
if (x <= -1.55e+81) {
tmp = t_2;
} else if (x <= -4.8e-48) {
tmp = t_1;
} else if (x <= -8.5e-94) {
tmp = x * (t / (z - y));
} else if ((x <= 1.12e-101) || (!(x <= 6.2e-15) && (x <= 5.1e+29))) {
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 = t * (y / (y - z))
t_2 = t * (x / (z - y))
if (x <= (-1.55d+81)) then
tmp = t_2
else if (x <= (-4.8d-48)) then
tmp = t_1
else if (x <= (-8.5d-94)) then
tmp = x * (t / (z - y))
else if ((x <= 1.12d-101) .or. (.not. (x <= 6.2d-15)) .and. (x <= 5.1d+29)) 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 = t * (y / (y - z));
double t_2 = t * (x / (z - y));
double tmp;
if (x <= -1.55e+81) {
tmp = t_2;
} else if (x <= -4.8e-48) {
tmp = t_1;
} else if (x <= -8.5e-94) {
tmp = x * (t / (z - y));
} else if ((x <= 1.12e-101) || (!(x <= 6.2e-15) && (x <= 5.1e+29))) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (y / (y - z)) t_2 = t * (x / (z - y)) tmp = 0 if x <= -1.55e+81: tmp = t_2 elif x <= -4.8e-48: tmp = t_1 elif x <= -8.5e-94: tmp = x * (t / (z - y)) elif (x <= 1.12e-101) or (not (x <= 6.2e-15) and (x <= 5.1e+29)): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(y / Float64(y - z))) t_2 = Float64(t * Float64(x / Float64(z - y))) tmp = 0.0 if (x <= -1.55e+81) tmp = t_2; elseif (x <= -4.8e-48) tmp = t_1; elseif (x <= -8.5e-94) tmp = Float64(x * Float64(t / Float64(z - y))); elseif ((x <= 1.12e-101) || (!(x <= 6.2e-15) && (x <= 5.1e+29))) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (y / (y - z)); t_2 = t * (x / (z - y)); tmp = 0.0; if (x <= -1.55e+81) tmp = t_2; elseif (x <= -4.8e-48) tmp = t_1; elseif (x <= -8.5e-94) tmp = x * (t / (z - y)); elseif ((x <= 1.12e-101) || (~((x <= 6.2e-15)) && (x <= 5.1e+29))) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.55e+81], t$95$2, If[LessEqual[x, -4.8e-48], t$95$1, If[LessEqual[x, -8.5e-94], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 1.12e-101], And[N[Not[LessEqual[x, 6.2e-15]], $MachinePrecision], LessEqual[x, 5.1e+29]]], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{y - z}\\
t_2 := t \cdot \frac{x}{z - y}\\
\mathbf{if}\;x \leq -1.55 \cdot 10^{+81}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-94}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{-101} \lor \neg \left(x \leq 6.2 \cdot 10^{-15}\right) \land x \leq 5.1 \cdot 10^{+29}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -1.55e81 or 1.12000000000000005e-101 < x < 6.1999999999999998e-15 or 5.1000000000000001e29 < x Initial program 96.8%
Taylor expanded in x around inf 81.4%
if -1.55e81 < x < -4.8e-48 or -8.50000000000000003e-94 < x < 1.12000000000000005e-101 or 6.1999999999999998e-15 < x < 5.1000000000000001e29Initial program 97.2%
Taylor expanded in x around 0 87.8%
neg-mul-187.8%
distribute-neg-frac87.8%
Simplified87.8%
frac-2neg87.8%
div-inv87.7%
remove-double-neg87.7%
sub-neg87.7%
distribute-neg-in87.7%
remove-double-neg87.7%
Applied egg-rr87.7%
associate-*r/87.8%
*-rgt-identity87.8%
+-commutative87.8%
unsub-neg87.8%
Simplified87.8%
if -4.8e-48 < x < -8.50000000000000003e-94Initial program 86.0%
associate-*l/92.9%
associate-*r/92.8%
Simplified92.8%
Taylor expanded in x around inf 75.5%
associate-*l/75.4%
*-commutative75.4%
Simplified75.4%
Final simplification83.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ y (- y z)))) (t_2 (/ t (/ (- z y) x))))
(if (<= x -1.3e+81)
t_2
(if (<= x -3.8e-45)
t_1
(if (<= x -8.5e-94)
(* x (/ t (- z y)))
(if (<= x 1.12e-101)
t_1
(if (<= x 6.2e-15)
(* t (/ x (- z y)))
(if (<= x 1.05e+25) t_1 t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (y / (y - z));
double t_2 = t / ((z - y) / x);
double tmp;
if (x <= -1.3e+81) {
tmp = t_2;
} else if (x <= -3.8e-45) {
tmp = t_1;
} else if (x <= -8.5e-94) {
tmp = x * (t / (z - y));
} else if (x <= 1.12e-101) {
tmp = t_1;
} else if (x <= 6.2e-15) {
tmp = t * (x / (z - y));
} else if (x <= 1.05e+25) {
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 = t * (y / (y - z))
t_2 = t / ((z - y) / x)
if (x <= (-1.3d+81)) then
tmp = t_2
else if (x <= (-3.8d-45)) then
tmp = t_1
else if (x <= (-8.5d-94)) then
tmp = x * (t / (z - y))
else if (x <= 1.12d-101) then
tmp = t_1
else if (x <= 6.2d-15) then
tmp = t * (x / (z - y))
else if (x <= 1.05d+25) 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 = t * (y / (y - z));
double t_2 = t / ((z - y) / x);
double tmp;
if (x <= -1.3e+81) {
tmp = t_2;
} else if (x <= -3.8e-45) {
tmp = t_1;
} else if (x <= -8.5e-94) {
tmp = x * (t / (z - y));
} else if (x <= 1.12e-101) {
tmp = t_1;
} else if (x <= 6.2e-15) {
tmp = t * (x / (z - y));
} else if (x <= 1.05e+25) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (y / (y - z)) t_2 = t / ((z - y) / x) tmp = 0 if x <= -1.3e+81: tmp = t_2 elif x <= -3.8e-45: tmp = t_1 elif x <= -8.5e-94: tmp = x * (t / (z - y)) elif x <= 1.12e-101: tmp = t_1 elif x <= 6.2e-15: tmp = t * (x / (z - y)) elif x <= 1.05e+25: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(y / Float64(y - z))) t_2 = Float64(t / Float64(Float64(z - y) / x)) tmp = 0.0 if (x <= -1.3e+81) tmp = t_2; elseif (x <= -3.8e-45) tmp = t_1; elseif (x <= -8.5e-94) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (x <= 1.12e-101) tmp = t_1; elseif (x <= 6.2e-15) tmp = Float64(t * Float64(x / Float64(z - y))); elseif (x <= 1.05e+25) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (y / (y - z)); t_2 = t / ((z - y) / x); tmp = 0.0; if (x <= -1.3e+81) tmp = t_2; elseif (x <= -3.8e-45) tmp = t_1; elseif (x <= -8.5e-94) tmp = x * (t / (z - y)); elseif (x <= 1.12e-101) tmp = t_1; elseif (x <= 6.2e-15) tmp = t * (x / (z - y)); elseif (x <= 1.05e+25) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.3e+81], t$95$2, If[LessEqual[x, -3.8e-45], t$95$1, If[LessEqual[x, -8.5e-94], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.12e-101], t$95$1, If[LessEqual[x, 6.2e-15], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.05e+25], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{y - z}\\
t_2 := \frac{t}{\frac{z - y}{x}}\\
\mathbf{if}\;x \leq -1.3 \cdot 10^{+81}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-94}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{-101}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-15}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+25}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -1.29999999999999996e81 or 1.05e25 < x Initial program 96.5%
associate-*l/80.9%
associate-*r/82.4%
Simplified82.4%
associate-*r/80.9%
associate-*l/96.5%
*-commutative96.5%
clear-num96.5%
un-div-inv97.5%
Applied egg-rr97.5%
Taylor expanded in x around inf 70.8%
associate-/l*82.7%
Simplified82.7%
if -1.29999999999999996e81 < x < -3.79999999999999997e-45 or -8.50000000000000003e-94 < x < 1.12000000000000005e-101 or 6.1999999999999998e-15 < x < 1.05e25Initial program 97.2%
Taylor expanded in x around 0 87.8%
neg-mul-187.8%
distribute-neg-frac87.8%
Simplified87.8%
frac-2neg87.8%
div-inv87.7%
remove-double-neg87.7%
sub-neg87.7%
distribute-neg-in87.7%
remove-double-neg87.7%
Applied egg-rr87.7%
associate-*r/87.8%
*-rgt-identity87.8%
+-commutative87.8%
unsub-neg87.8%
Simplified87.8%
if -3.79999999999999997e-45 < x < -8.50000000000000003e-94Initial program 86.0%
associate-*l/92.9%
associate-*r/92.8%
Simplified92.8%
Taylor expanded in x around inf 75.5%
associate-*l/75.4%
*-commutative75.4%
Simplified75.4%
if 1.12000000000000005e-101 < x < 6.1999999999999998e-15Initial program 99.8%
Taylor expanded in x around inf 77.9%
Final simplification84.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ y (- y z)))) (t_2 (/ t (/ (- z y) x))))
(if (<= x -7.5e+80)
t_2
(if (<= x -6.2e-49)
t_1
(if (<= x -8.5e-94)
(/ (* t x) (- z y))
(if (<= x 9e-102)
t_1
(if (<= x 6.2e-15)
(* t (/ x (- z y)))
(if (<= x 2.05e+27) t_1 t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (y / (y - z));
double t_2 = t / ((z - y) / x);
double tmp;
if (x <= -7.5e+80) {
tmp = t_2;
} else if (x <= -6.2e-49) {
tmp = t_1;
} else if (x <= -8.5e-94) {
tmp = (t * x) / (z - y);
} else if (x <= 9e-102) {
tmp = t_1;
} else if (x <= 6.2e-15) {
tmp = t * (x / (z - y));
} else if (x <= 2.05e+27) {
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 = t * (y / (y - z))
t_2 = t / ((z - y) / x)
if (x <= (-7.5d+80)) then
tmp = t_2
else if (x <= (-6.2d-49)) then
tmp = t_1
else if (x <= (-8.5d-94)) then
tmp = (t * x) / (z - y)
else if (x <= 9d-102) then
tmp = t_1
else if (x <= 6.2d-15) then
tmp = t * (x / (z - y))
else if (x <= 2.05d+27) 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 = t * (y / (y - z));
double t_2 = t / ((z - y) / x);
double tmp;
if (x <= -7.5e+80) {
tmp = t_2;
} else if (x <= -6.2e-49) {
tmp = t_1;
} else if (x <= -8.5e-94) {
tmp = (t * x) / (z - y);
} else if (x <= 9e-102) {
tmp = t_1;
} else if (x <= 6.2e-15) {
tmp = t * (x / (z - y));
} else if (x <= 2.05e+27) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (y / (y - z)) t_2 = t / ((z - y) / x) tmp = 0 if x <= -7.5e+80: tmp = t_2 elif x <= -6.2e-49: tmp = t_1 elif x <= -8.5e-94: tmp = (t * x) / (z - y) elif x <= 9e-102: tmp = t_1 elif x <= 6.2e-15: tmp = t * (x / (z - y)) elif x <= 2.05e+27: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(y / Float64(y - z))) t_2 = Float64(t / Float64(Float64(z - y) / x)) tmp = 0.0 if (x <= -7.5e+80) tmp = t_2; elseif (x <= -6.2e-49) tmp = t_1; elseif (x <= -8.5e-94) tmp = Float64(Float64(t * x) / Float64(z - y)); elseif (x <= 9e-102) tmp = t_1; elseif (x <= 6.2e-15) tmp = Float64(t * Float64(x / Float64(z - y))); elseif (x <= 2.05e+27) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (y / (y - z)); t_2 = t / ((z - y) / x); tmp = 0.0; if (x <= -7.5e+80) tmp = t_2; elseif (x <= -6.2e-49) tmp = t_1; elseif (x <= -8.5e-94) tmp = (t * x) / (z - y); elseif (x <= 9e-102) tmp = t_1; elseif (x <= 6.2e-15) tmp = t * (x / (z - y)); elseif (x <= 2.05e+27) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.5e+80], t$95$2, If[LessEqual[x, -6.2e-49], t$95$1, If[LessEqual[x, -8.5e-94], N[(N[(t * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9e-102], t$95$1, If[LessEqual[x, 6.2e-15], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.05e+27], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{y - z}\\
t_2 := \frac{t}{\frac{z - y}{x}}\\
\mathbf{if}\;x \leq -7.5 \cdot 10^{+80}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{-49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-94}:\\
\;\;\;\;\frac{t \cdot x}{z - y}\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-15}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{+27}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -7.49999999999999994e80 or 2.0500000000000001e27 < x Initial program 96.5%
associate-*l/80.9%
associate-*r/82.4%
Simplified82.4%
associate-*r/80.9%
associate-*l/96.5%
*-commutative96.5%
clear-num96.5%
un-div-inv97.5%
Applied egg-rr97.5%
Taylor expanded in x around inf 70.8%
associate-/l*82.7%
Simplified82.7%
if -7.49999999999999994e80 < x < -6.2e-49 or -8.50000000000000003e-94 < x < 8.99999999999999999e-102 or 6.1999999999999998e-15 < x < 2.0500000000000001e27Initial program 97.2%
Taylor expanded in x around 0 87.8%
neg-mul-187.8%
distribute-neg-frac87.8%
Simplified87.8%
frac-2neg87.8%
div-inv87.7%
remove-double-neg87.7%
sub-neg87.7%
distribute-neg-in87.7%
remove-double-neg87.7%
Applied egg-rr87.7%
associate-*r/87.8%
*-rgt-identity87.8%
+-commutative87.8%
unsub-neg87.8%
Simplified87.8%
if -6.2e-49 < x < -8.50000000000000003e-94Initial program 86.0%
associate-*l/92.9%
associate-*r/92.8%
Simplified92.8%
Taylor expanded in x around inf 75.5%
if 8.99999999999999999e-102 < x < 6.1999999999999998e-15Initial program 99.8%
Taylor expanded in x around inf 77.9%
Final simplification84.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.28e+45)
t
(if (<= y -2e-37)
(* t (/ (- x) y))
(if (<= y 6.6e-36)
(* x (/ t z))
(if (<= y 1.52e+44)
(/ (* t y) y)
(if (<= y 3.35e+75) (* (- t) (/ y z)) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.28e+45) {
tmp = t;
} else if (y <= -2e-37) {
tmp = t * (-x / y);
} else if (y <= 6.6e-36) {
tmp = x * (t / z);
} else if (y <= 1.52e+44) {
tmp = (t * y) / y;
} else if (y <= 3.35e+75) {
tmp = -t * (y / z);
} else {
tmp = 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 <= (-1.28d+45)) then
tmp = t
else if (y <= (-2d-37)) then
tmp = t * (-x / y)
else if (y <= 6.6d-36) then
tmp = x * (t / z)
else if (y <= 1.52d+44) then
tmp = (t * y) / y
else if (y <= 3.35d+75) then
tmp = -t * (y / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.28e+45) {
tmp = t;
} else if (y <= -2e-37) {
tmp = t * (-x / y);
} else if (y <= 6.6e-36) {
tmp = x * (t / z);
} else if (y <= 1.52e+44) {
tmp = (t * y) / y;
} else if (y <= 3.35e+75) {
tmp = -t * (y / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.28e+45: tmp = t elif y <= -2e-37: tmp = t * (-x / y) elif y <= 6.6e-36: tmp = x * (t / z) elif y <= 1.52e+44: tmp = (t * y) / y elif y <= 3.35e+75: tmp = -t * (y / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.28e+45) tmp = t; elseif (y <= -2e-37) tmp = Float64(t * Float64(Float64(-x) / y)); elseif (y <= 6.6e-36) tmp = Float64(x * Float64(t / z)); elseif (y <= 1.52e+44) tmp = Float64(Float64(t * y) / y); elseif (y <= 3.35e+75) tmp = Float64(Float64(-t) * Float64(y / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.28e+45) tmp = t; elseif (y <= -2e-37) tmp = t * (-x / y); elseif (y <= 6.6e-36) tmp = x * (t / z); elseif (y <= 1.52e+44) tmp = (t * y) / y; elseif (y <= 3.35e+75) tmp = -t * (y / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.28e+45], t, If[LessEqual[y, -2e-37], N[(t * N[((-x) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e-36], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.52e+44], N[(N[(t * y), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 3.35e+75], N[((-t) * N[(y / z), $MachinePrecision]), $MachinePrecision], t]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.28 \cdot 10^{+45}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -2 \cdot 10^{-37}:\\
\;\;\;\;t \cdot \frac{-x}{y}\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 1.52 \cdot 10^{+44}:\\
\;\;\;\;\frac{t \cdot y}{y}\\
\mathbf{elif}\;y \leq 3.35 \cdot 10^{+75}:\\
\;\;\;\;\left(-t\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.28000000000000002e45 or 3.35e75 < y Initial program 99.8%
associate-*l/71.5%
associate-*r/66.4%
Simplified66.4%
Taylor expanded in y around inf 57.3%
if -1.28000000000000002e45 < y < -2.00000000000000013e-37Initial program 99.6%
associate-*l/84.8%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in x around inf 70.2%
associate-*l/70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in z around 0 64.2%
associate-*r/64.2%
mul-1-neg64.2%
distribute-lft-neg-out64.2%
*-commutative64.2%
Simplified64.2%
Taylor expanded in x around 0 64.2%
mul-1-neg64.2%
associate-*r/64.1%
*-commutative64.1%
distribute-rgt-neg-in64.1%
Simplified64.1%
if -2.00000000000000013e-37 < y < 6.59999999999999981e-36Initial program 92.2%
associate-*l/92.2%
associate-*r/94.7%
Simplified94.7%
associate-*r/92.2%
associate-*l/92.2%
*-commutative92.2%
clear-num92.2%
un-div-inv93.2%
Applied egg-rr93.2%
Taylor expanded in y around 0 65.1%
associate-*l/70.1%
*-commutative70.1%
Simplified70.1%
if 6.59999999999999981e-36 < y < 1.52000000000000003e44Initial program 99.7%
associate-*l/84.1%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in z around 0 72.7%
associate-*r/72.7%
*-commutative72.7%
neg-mul-172.7%
distribute-rgt-neg-in72.7%
Simplified72.7%
Taylor expanded in x around 0 46.3%
if 1.52000000000000003e44 < y < 3.35e75Initial program 99.0%
Taylor expanded in x around 0 67.2%
neg-mul-167.2%
distribute-neg-frac67.2%
Simplified67.2%
Taylor expanded in y around 0 66.1%
mul-1-neg66.1%
distribute-neg-frac66.1%
Simplified66.1%
Final simplification62.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.15e+45)
t
(if (<= y -1.65e-37)
(/ (* t (- x)) y)
(if (<= y 6.6e-36)
(* x (/ t z))
(if (<= y 1.85e+46)
(/ (* t y) y)
(if (<= y 1.26e+75) (* (- t) (/ y z)) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.15e+45) {
tmp = t;
} else if (y <= -1.65e-37) {
tmp = (t * -x) / y;
} else if (y <= 6.6e-36) {
tmp = x * (t / z);
} else if (y <= 1.85e+46) {
tmp = (t * y) / y;
} else if (y <= 1.26e+75) {
tmp = -t * (y / z);
} else {
tmp = 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 <= (-1.15d+45)) then
tmp = t
else if (y <= (-1.65d-37)) then
tmp = (t * -x) / y
else if (y <= 6.6d-36) then
tmp = x * (t / z)
else if (y <= 1.85d+46) then
tmp = (t * y) / y
else if (y <= 1.26d+75) then
tmp = -t * (y / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.15e+45) {
tmp = t;
} else if (y <= -1.65e-37) {
tmp = (t * -x) / y;
} else if (y <= 6.6e-36) {
tmp = x * (t / z);
} else if (y <= 1.85e+46) {
tmp = (t * y) / y;
} else if (y <= 1.26e+75) {
tmp = -t * (y / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.15e+45: tmp = t elif y <= -1.65e-37: tmp = (t * -x) / y elif y <= 6.6e-36: tmp = x * (t / z) elif y <= 1.85e+46: tmp = (t * y) / y elif y <= 1.26e+75: tmp = -t * (y / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.15e+45) tmp = t; elseif (y <= -1.65e-37) tmp = Float64(Float64(t * Float64(-x)) / y); elseif (y <= 6.6e-36) tmp = Float64(x * Float64(t / z)); elseif (y <= 1.85e+46) tmp = Float64(Float64(t * y) / y); elseif (y <= 1.26e+75) tmp = Float64(Float64(-t) * Float64(y / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.15e+45) tmp = t; elseif (y <= -1.65e-37) tmp = (t * -x) / y; elseif (y <= 6.6e-36) tmp = x * (t / z); elseif (y <= 1.85e+46) tmp = (t * y) / y; elseif (y <= 1.26e+75) tmp = -t * (y / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.15e+45], t, If[LessEqual[y, -1.65e-37], N[(N[(t * (-x)), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 6.6e-36], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e+46], N[(N[(t * y), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 1.26e+75], N[((-t) * N[(y / z), $MachinePrecision]), $MachinePrecision], t]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+45}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -1.65 \cdot 10^{-37}:\\
\;\;\;\;\frac{t \cdot \left(-x\right)}{y}\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{+46}:\\
\;\;\;\;\frac{t \cdot y}{y}\\
\mathbf{elif}\;y \leq 1.26 \cdot 10^{+75}:\\
\;\;\;\;\left(-t\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.15000000000000006e45 or 1.26000000000000003e75 < y Initial program 99.8%
associate-*l/71.5%
associate-*r/66.4%
Simplified66.4%
Taylor expanded in y around inf 57.3%
if -1.15000000000000006e45 < y < -1.64999999999999991e-37Initial program 99.6%
associate-*l/84.8%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around 0 63.0%
associate-*r/63.0%
*-commutative63.0%
neg-mul-163.0%
distribute-rgt-neg-in63.0%
Simplified63.0%
Taylor expanded in x around inf 64.2%
associate-*r/64.2%
neg-mul-164.2%
distribute-rgt-neg-in64.2%
Simplified64.2%
if -1.64999999999999991e-37 < y < 6.59999999999999981e-36Initial program 92.2%
associate-*l/92.2%
associate-*r/94.7%
Simplified94.7%
associate-*r/92.2%
associate-*l/92.2%
*-commutative92.2%
clear-num92.2%
un-div-inv93.2%
Applied egg-rr93.2%
Taylor expanded in y around 0 65.1%
associate-*l/70.1%
*-commutative70.1%
Simplified70.1%
if 6.59999999999999981e-36 < y < 1.84999999999999995e46Initial program 99.7%
associate-*l/84.1%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in z around 0 72.7%
associate-*r/72.7%
*-commutative72.7%
neg-mul-172.7%
distribute-rgt-neg-in72.7%
Simplified72.7%
Taylor expanded in x around 0 46.3%
if 1.84999999999999995e46 < y < 1.26000000000000003e75Initial program 99.0%
Taylor expanded in x around 0 67.2%
neg-mul-167.2%
distribute-neg-frac67.2%
Simplified67.2%
Taylor expanded in y around 0 66.1%
mul-1-neg66.1%
distribute-neg-frac66.1%
Simplified66.1%
Final simplification62.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.2e+44)
t
(if (<= y -1.75e-37)
(/ (* t (- x)) y)
(if (<= y 5.4e-40)
(* x (/ t z))
(if (<= y 8.2e+49)
(/ (* t y) y)
(if (<= y 2.65e+75) (- (/ (* t y) z)) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.2e+44) {
tmp = t;
} else if (y <= -1.75e-37) {
tmp = (t * -x) / y;
} else if (y <= 5.4e-40) {
tmp = x * (t / z);
} else if (y <= 8.2e+49) {
tmp = (t * y) / y;
} else if (y <= 2.65e+75) {
tmp = -((t * y) / z);
} else {
tmp = 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 <= (-1.2d+44)) then
tmp = t
else if (y <= (-1.75d-37)) then
tmp = (t * -x) / y
else if (y <= 5.4d-40) then
tmp = x * (t / z)
else if (y <= 8.2d+49) then
tmp = (t * y) / y
else if (y <= 2.65d+75) then
tmp = -((t * y) / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.2e+44) {
tmp = t;
} else if (y <= -1.75e-37) {
tmp = (t * -x) / y;
} else if (y <= 5.4e-40) {
tmp = x * (t / z);
} else if (y <= 8.2e+49) {
tmp = (t * y) / y;
} else if (y <= 2.65e+75) {
tmp = -((t * y) / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.2e+44: tmp = t elif y <= -1.75e-37: tmp = (t * -x) / y elif y <= 5.4e-40: tmp = x * (t / z) elif y <= 8.2e+49: tmp = (t * y) / y elif y <= 2.65e+75: tmp = -((t * y) / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.2e+44) tmp = t; elseif (y <= -1.75e-37) tmp = Float64(Float64(t * Float64(-x)) / y); elseif (y <= 5.4e-40) tmp = Float64(x * Float64(t / z)); elseif (y <= 8.2e+49) tmp = Float64(Float64(t * y) / y); elseif (y <= 2.65e+75) tmp = Float64(-Float64(Float64(t * y) / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.2e+44) tmp = t; elseif (y <= -1.75e-37) tmp = (t * -x) / y; elseif (y <= 5.4e-40) tmp = x * (t / z); elseif (y <= 8.2e+49) tmp = (t * y) / y; elseif (y <= 2.65e+75) tmp = -((t * y) / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.2e+44], t, If[LessEqual[y, -1.75e-37], N[(N[(t * (-x)), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 5.4e-40], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e+49], N[(N[(t * y), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 2.65e+75], (-N[(N[(t * y), $MachinePrecision] / z), $MachinePrecision]), t]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+44}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -1.75 \cdot 10^{-37}:\\
\;\;\;\;\frac{t \cdot \left(-x\right)}{y}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-40}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+49}:\\
\;\;\;\;\frac{t \cdot y}{y}\\
\mathbf{elif}\;y \leq 2.65 \cdot 10^{+75}:\\
\;\;\;\;-\frac{t \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.20000000000000007e44 or 2.6499999999999999e75 < y Initial program 99.8%
associate-*l/71.5%
associate-*r/66.4%
Simplified66.4%
Taylor expanded in y around inf 57.3%
if -1.20000000000000007e44 < y < -1.7500000000000001e-37Initial program 99.6%
associate-*l/84.8%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around 0 63.0%
associate-*r/63.0%
*-commutative63.0%
neg-mul-163.0%
distribute-rgt-neg-in63.0%
Simplified63.0%
Taylor expanded in x around inf 64.2%
associate-*r/64.2%
neg-mul-164.2%
distribute-rgt-neg-in64.2%
Simplified64.2%
if -1.7500000000000001e-37 < y < 5.4e-40Initial program 92.2%
associate-*l/92.2%
associate-*r/94.7%
Simplified94.7%
associate-*r/92.2%
associate-*l/92.2%
*-commutative92.2%
clear-num92.2%
un-div-inv93.2%
Applied egg-rr93.2%
Taylor expanded in y around 0 65.1%
associate-*l/70.1%
*-commutative70.1%
Simplified70.1%
if 5.4e-40 < y < 8.2e49Initial program 99.7%
associate-*l/84.1%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in z around 0 72.7%
associate-*r/72.7%
*-commutative72.7%
neg-mul-172.7%
distribute-rgt-neg-in72.7%
Simplified72.7%
Taylor expanded in x around 0 46.3%
if 8.2e49 < y < 2.6499999999999999e75Initial program 99.0%
associate-*l/99.2%
associate-*r/84.8%
Simplified84.8%
Taylor expanded in z around inf 82.6%
Taylor expanded in x around 0 66.3%
mul-1-neg66.3%
distribute-lft-neg-out66.3%
*-commutative66.3%
Simplified66.3%
Final simplification62.7%
(FPCore (x y z t) :precision binary64 (if (<= y -3.9e+165) (* t (- 1.0 (/ x y))) (if (<= y 3.9e+172) (* (- x y) (/ t (- z y))) (* t (/ y (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.9e+165) {
tmp = t * (1.0 - (x / y));
} else if (y <= 3.9e+172) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t * (y / (y - 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 (y <= (-3.9d+165)) then
tmp = t * (1.0d0 - (x / y))
else if (y <= 3.9d+172) then
tmp = (x - y) * (t / (z - y))
else
tmp = t * (y / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.9e+165) {
tmp = t * (1.0 - (x / y));
} else if (y <= 3.9e+172) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.9e+165: tmp = t * (1.0 - (x / y)) elif y <= 3.9e+172: tmp = (x - y) * (t / (z - y)) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.9e+165) tmp = Float64(t * Float64(1.0 - Float64(x / y))); elseif (y <= 3.9e+172) tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); else tmp = Float64(t * Float64(y / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.9e+165) tmp = t * (1.0 - (x / y)); elseif (y <= 3.9e+172) tmp = (x - y) * (t / (z - y)); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.9e+165], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e+172], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{+165}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+172}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if y < -3.89999999999999975e165Initial program 99.9%
div-sub99.9%
flip--42.1%
associate-/r/42.1%
fma-neg42.1%
+-commutative42.1%
Applied egg-rr42.1%
fma-udef42.1%
unsub-neg42.1%
associate-*l/33.3%
Simplified33.3%
Taylor expanded in z around 0 85.9%
mul-1-neg85.9%
unsub-neg85.9%
Simplified85.9%
if -3.89999999999999975e165 < y < 3.89999999999999967e172Initial program 95.4%
associate-*l/87.2%
associate-*r/91.2%
Simplified91.2%
if 3.89999999999999967e172 < y Initial program 99.8%
Taylor expanded in x around 0 87.1%
neg-mul-187.1%
distribute-neg-frac87.1%
Simplified87.1%
frac-2neg87.1%
div-inv87.0%
remove-double-neg87.0%
sub-neg87.0%
distribute-neg-in87.0%
remove-double-neg87.0%
Applied egg-rr87.0%
associate-*r/87.1%
*-rgt-identity87.1%
+-commutative87.1%
unsub-neg87.1%
Simplified87.1%
Final simplification90.1%
(FPCore (x y z t) :precision binary64 (if (<= y -5.9e+44) t (if (<= y -1.8e-37) (* t (/ (- x) y)) (if (<= y 8.5e-36) (* x (/ t z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.9e+44) {
tmp = t;
} else if (y <= -1.8e-37) {
tmp = t * (-x / y);
} else if (y <= 8.5e-36) {
tmp = x * (t / z);
} else {
tmp = 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 <= (-5.9d+44)) then
tmp = t
else if (y <= (-1.8d-37)) then
tmp = t * (-x / y)
else if (y <= 8.5d-36) then
tmp = x * (t / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.9e+44) {
tmp = t;
} else if (y <= -1.8e-37) {
tmp = t * (-x / y);
} else if (y <= 8.5e-36) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.9e+44: tmp = t elif y <= -1.8e-37: tmp = t * (-x / y) elif y <= 8.5e-36: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.9e+44) tmp = t; elseif (y <= -1.8e-37) tmp = Float64(t * Float64(Float64(-x) / y)); elseif (y <= 8.5e-36) tmp = Float64(x * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5.9e+44) tmp = t; elseif (y <= -1.8e-37) tmp = t * (-x / y); elseif (y <= 8.5e-36) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.9e+44], t, If[LessEqual[y, -1.8e-37], N[(t * N[((-x) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e-36], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.9 \cdot 10^{+44}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-37}:\\
\;\;\;\;t \cdot \frac{-x}{y}\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -5.89999999999999965e44 or 8.5000000000000007e-36 < y Initial program 99.7%
associate-*l/74.5%
associate-*r/71.8%
Simplified71.8%
Taylor expanded in y around inf 52.7%
if -5.89999999999999965e44 < y < -1.80000000000000004e-37Initial program 99.6%
associate-*l/84.8%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in x around inf 70.2%
associate-*l/70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in z around 0 64.2%
associate-*r/64.2%
mul-1-neg64.2%
distribute-lft-neg-out64.2%
*-commutative64.2%
Simplified64.2%
Taylor expanded in x around 0 64.2%
mul-1-neg64.2%
associate-*r/64.1%
*-commutative64.1%
distribute-rgt-neg-in64.1%
Simplified64.1%
if -1.80000000000000004e-37 < y < 8.5000000000000007e-36Initial program 92.2%
associate-*l/92.2%
associate-*r/94.7%
Simplified94.7%
associate-*r/92.2%
associate-*l/92.2%
*-commutative92.2%
clear-num92.2%
un-div-inv93.2%
Applied egg-rr93.2%
Taylor expanded in y around 0 65.1%
associate-*l/70.1%
*-commutative70.1%
Simplified70.1%
Final simplification60.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.75e-37) (not (<= y 4.8e-38))) (* t (- 1.0 (/ x y))) (* x (/ t z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.75e-37) || !(y <= 4.8e-38)) {
tmp = t * (1.0 - (x / y));
} 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 ((y <= (-1.75d-37)) .or. (.not. (y <= 4.8d-38))) then
tmp = t * (1.0d0 - (x / y))
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 ((y <= -1.75e-37) || !(y <= 4.8e-38)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.75e-37) or not (y <= 4.8e-38): tmp = t * (1.0 - (x / y)) else: tmp = x * (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.75e-37) || !(y <= 4.8e-38)) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.75e-37) || ~((y <= 4.8e-38))) tmp = t * (1.0 - (x / y)); else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.75e-37], N[Not[LessEqual[y, 4.8e-38]], $MachinePrecision]], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{-37} \lor \neg \left(y \leq 4.8 \cdot 10^{-38}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if y < -1.7500000000000001e-37 or 4.80000000000000044e-38 < y Initial program 99.7%
div-sub99.7%
flip--72.7%
associate-/r/72.7%
fma-neg72.7%
+-commutative72.7%
Applied egg-rr72.7%
fma-udef72.7%
unsub-neg72.7%
associate-*l/59.1%
Simplified59.1%
Taylor expanded in z around 0 72.5%
mul-1-neg72.5%
unsub-neg72.5%
Simplified72.5%
if -1.7500000000000001e-37 < y < 4.80000000000000044e-38Initial program 92.2%
associate-*l/92.2%
associate-*r/94.7%
Simplified94.7%
associate-*r/92.2%
associate-*l/92.2%
*-commutative92.2%
clear-num92.2%
un-div-inv93.2%
Applied egg-rr93.2%
Taylor expanded in y around 0 65.1%
associate-*l/70.1%
*-commutative70.1%
Simplified70.1%
Final simplification71.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -0.125) (not (<= y 2.85e+20))) (* t (- 1.0 (/ x y))) (* x (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -0.125) || !(y <= 2.85e+20)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = x * (t / (z - 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 ((y <= (-0.125d0)) .or. (.not. (y <= 2.85d+20))) then
tmp = t * (1.0d0 - (x / y))
else
tmp = x * (t / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -0.125) || !(y <= 2.85e+20)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -0.125) or not (y <= 2.85e+20): tmp = t * (1.0 - (x / y)) else: tmp = x * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -0.125) || !(y <= 2.85e+20)) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = Float64(x * Float64(t / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -0.125) || ~((y <= 2.85e+20))) tmp = t * (1.0 - (x / y)); else tmp = x * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -0.125], N[Not[LessEqual[y, 2.85e+20]], $MachinePrecision]], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.125 \lor \neg \left(y \leq 2.85 \cdot 10^{+20}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -0.125 or 2.85e20 < y Initial program 99.7%
div-sub99.8%
flip--70.6%
associate-/r/70.7%
fma-neg70.7%
+-commutative70.7%
Applied egg-rr70.7%
fma-udef70.7%
unsub-neg70.7%
associate-*l/55.3%
Simplified55.3%
Taylor expanded in z around 0 73.5%
mul-1-neg73.5%
unsub-neg73.5%
Simplified73.5%
if -0.125 < y < 2.85e20Initial program 93.1%
associate-*l/91.8%
associate-*r/95.3%
Simplified95.3%
Taylor expanded in x around inf 76.2%
associate-*l/80.5%
*-commutative80.5%
Simplified80.5%
Final simplification77.0%
(FPCore (x y z t) :precision binary64 (if (<= y -9e+43) t (if (<= y 8.5e-36) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e+43) {
tmp = t;
} else if (y <= 8.5e-36) {
tmp = x * (t / z);
} else {
tmp = 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 <= (-9d+43)) then
tmp = t
else if (y <= 8.5d-36) then
tmp = x * (t / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e+43) {
tmp = t;
} else if (y <= 8.5e-36) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9e+43: tmp = t elif y <= 8.5e-36: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9e+43) tmp = t; elseif (y <= 8.5e-36) tmp = Float64(x * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -9e+43) tmp = t; elseif (y <= 8.5e-36) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9e+43], t, If[LessEqual[y, 8.5e-36], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+43}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -9e43 or 8.5000000000000007e-36 < y Initial program 99.7%
associate-*l/74.5%
associate-*r/71.8%
Simplified71.8%
Taylor expanded in y around inf 52.7%
if -9e43 < y < 8.5000000000000007e-36Initial program 92.9%
associate-*l/91.4%
associate-*r/95.2%
Simplified95.2%
associate-*r/91.4%
associate-*l/92.9%
*-commutative92.9%
clear-num93.0%
un-div-inv93.9%
Applied egg-rr93.9%
Taylor expanded in y around 0 60.3%
associate-*l/64.8%
*-commutative64.8%
Simplified64.8%
Final simplification58.6%
(FPCore (x y z t) :precision binary64 (if (<= y -8.2e+124) t (if (<= y 6.7e-38) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.2e+124) {
tmp = t;
} else if (y <= 6.7e-38) {
tmp = t * (x / z);
} else {
tmp = 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 <= (-8.2d+124)) then
tmp = t
else if (y <= 6.7d-38) then
tmp = t * (x / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.2e+124) {
tmp = t;
} else if (y <= 6.7e-38) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.2e+124: tmp = t elif y <= 6.7e-38: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.2e+124) tmp = t; elseif (y <= 6.7e-38) tmp = Float64(t * Float64(x / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8.2e+124) tmp = t; elseif (y <= 6.7e-38) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.2e+124], t, If[LessEqual[y, 6.7e-38], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{+124}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 6.7 \cdot 10^{-38}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -8.20000000000000002e124 or 6.7000000000000004e-38 < y Initial program 99.7%
associate-*l/74.0%
associate-*r/72.4%
Simplified72.4%
Taylor expanded in y around inf 57.2%
if -8.20000000000000002e124 < y < 6.7000000000000004e-38Initial program 93.9%
Taylor expanded in y around 0 60.0%
Final simplification58.8%
(FPCore (x y z t) :precision binary64 (if (<= y -1.95e+124) t (if (<= y 8.2e-36) (/ t (/ z x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.95e+124) {
tmp = t;
} else if (y <= 8.2e-36) {
tmp = t / (z / x);
} else {
tmp = 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 <= (-1.95d+124)) then
tmp = t
else if (y <= 8.2d-36) then
tmp = t / (z / x)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.95e+124) {
tmp = t;
} else if (y <= 8.2e-36) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.95e+124: tmp = t elif y <= 8.2e-36: tmp = t / (z / x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.95e+124) tmp = t; elseif (y <= 8.2e-36) tmp = Float64(t / Float64(z / x)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.95e+124) tmp = t; elseif (y <= 8.2e-36) tmp = t / (z / x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.95e+124], t, If[LessEqual[y, 8.2e-36], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.95 \cdot 10^{+124}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-36}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.95e124 or 8.20000000000000025e-36 < y Initial program 99.7%
associate-*l/74.0%
associate-*r/72.4%
Simplified72.4%
Taylor expanded in y around inf 57.2%
if -1.95e124 < y < 8.20000000000000025e-36Initial program 93.9%
associate-*l/89.4%
associate-*r/91.4%
Simplified91.4%
Taylor expanded in y around 0 55.6%
associate-/l*60.1%
Simplified60.1%
Final simplification58.9%
(FPCore (x y z t) :precision binary64 (* t (/ (- x y) (- z y))))
double code(double x, double y, double z, double t) {
return t * ((x - y) / (z - y));
}
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 - y) / (z - y))
end function
public static double code(double x, double y, double z, double t) {
return t * ((x - y) / (z - y));
}
def code(x, y, z, t): return t * ((x - y) / (z - y))
function code(x, y, z, t) return Float64(t * Float64(Float64(x - y) / Float64(z - y))) end
function tmp = code(x, y, z, t) tmp = t * ((x - y) / (z - y)); end
code[x_, y_, z_, t_] := N[(t * N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \frac{x - y}{z - y}
\end{array}
Initial program 96.4%
Final simplification96.4%
(FPCore (x y z t) :precision binary64 t)
double code(double x, double y, double z, double t) {
return 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 = t
end function
public static double code(double x, double y, double z, double t) {
return t;
}
def code(x, y, z, t): return t
function code(x, y, z, t) return t end
function tmp = code(x, y, z, t) tmp = t; end
code[x_, y_, z_, t_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 96.4%
associate-*l/82.8%
associate-*r/83.2%
Simplified83.2%
Taylor expanded in y around inf 32.8%
Final simplification32.8%
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
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 / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
herbie shell --seed 2023240
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(/ t (/ (- z y) (- x y)))
(* (/ (- x y) (- z y)) t))