
(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (- z t)) t))
double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + 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 - t)) + t
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
def code(x, y, z, t): return ((x / y) * (z - t)) + t
function code(x, y, z, t) return Float64(Float64(Float64(x / y) * Float64(z - t)) + t) end
function tmp = code(x, y, z, t) tmp = ((x / y) * (z - t)) + t; end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} \cdot \left(z - t\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 t)) t))
double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + 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 - t)) + t
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
def code(x, y, z, t): return ((x / y) * (z - t)) + t
function code(x, y, z, t) return Float64(Float64(Float64(x / y) * Float64(z - t)) + t) end
function tmp = code(x, y, z, t) tmp = ((x / y) * (z - t)) + t; end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} \cdot \left(z - t\right) + t
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) (- INFINITY)) (* x (/ (- z t) y)) (fma (/ x y) (- z t) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -((double) INFINITY)) {
tmp = x * ((z - t) / y);
} else {
tmp = fma((x / y), (z - t), t);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= Float64(-Inf)) tmp = Float64(x * Float64(Float64(z - t) / y)); else tmp = fma(Float64(x / y), Float64(z - t), t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], (-Infinity)], N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision] + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -\infty:\\
\;\;\;\;x \cdot \frac{z - t}{y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{y}, z - t, t\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -inf.0Initial program 76.8%
Taylor expanded in x around 0 99.9%
Taylor expanded in x around -inf 99.9%
associate-/l*100.0%
*-commutative100.0%
Applied egg-rr100.0%
if -inf.0 < (/.f64 x y) Initial program 99.4%
fma-define99.4%
Simplified99.4%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x y) z)))
(if (<= (/ x y) -4e+159)
(/ (* x t) (- y))
(if (<= (/ x y) -2e-101)
t_1
(if (<= (/ x y) 4e-41)
t
(if (<= (/ x y) 2e+30) t_1 (* (/ x y) (- t))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) * z;
double tmp;
if ((x / y) <= -4e+159) {
tmp = (x * t) / -y;
} else if ((x / y) <= -2e-101) {
tmp = t_1;
} else if ((x / y) <= 4e-41) {
tmp = t;
} else if ((x / y) <= 2e+30) {
tmp = t_1;
} else {
tmp = (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) :: t_1
real(8) :: tmp
t_1 = (x / y) * z
if ((x / y) <= (-4d+159)) then
tmp = (x * t) / -y
else if ((x / y) <= (-2d-101)) then
tmp = t_1
else if ((x / y) <= 4d-41) then
tmp = t
else if ((x / y) <= 2d+30) then
tmp = t_1
else
tmp = (x / y) * -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) * z;
double tmp;
if ((x / y) <= -4e+159) {
tmp = (x * t) / -y;
} else if ((x / y) <= -2e-101) {
tmp = t_1;
} else if ((x / y) <= 4e-41) {
tmp = t;
} else if ((x / y) <= 2e+30) {
tmp = t_1;
} else {
tmp = (x / y) * -t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) * z tmp = 0 if (x / y) <= -4e+159: tmp = (x * t) / -y elif (x / y) <= -2e-101: tmp = t_1 elif (x / y) <= 4e-41: tmp = t elif (x / y) <= 2e+30: tmp = t_1 else: tmp = (x / y) * -t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) * z) tmp = 0.0 if (Float64(x / y) <= -4e+159) tmp = Float64(Float64(x * t) / Float64(-y)); elseif (Float64(x / y) <= -2e-101) tmp = t_1; elseif (Float64(x / y) <= 4e-41) tmp = t; elseif (Float64(x / y) <= 2e+30) tmp = t_1; else tmp = Float64(Float64(x / y) * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) * z; tmp = 0.0; if ((x / y) <= -4e+159) tmp = (x * t) / -y; elseif ((x / y) <= -2e-101) tmp = t_1; elseif ((x / y) <= 4e-41) tmp = t; elseif ((x / y) <= 2e+30) tmp = t_1; else tmp = (x / y) * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -4e+159], N[(N[(x * t), $MachinePrecision] / (-y)), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -2e-101], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 4e-41], t, If[LessEqual[N[(x / y), $MachinePrecision], 2e+30], t$95$1, N[(N[(x / y), $MachinePrecision] * (-t)), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot z\\
\mathbf{if}\;\frac{x}{y} \leq -4 \cdot 10^{+159}:\\
\;\;\;\;\frac{x \cdot t}{-y}\\
\mathbf{elif}\;\frac{x}{y} \leq -2 \cdot 10^{-101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 4 \cdot 10^{-41}:\\
\;\;\;\;t\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -3.9999999999999997e159Initial program 85.9%
Taylor expanded in z around 0 64.5%
mul-1-neg64.5%
unsub-neg64.5%
*-rgt-identity64.5%
associate-/l*58.9%
distribute-lft-out--58.9%
Simplified58.9%
Taylor expanded in x around inf 58.9%
mul-1-neg58.9%
distribute-frac-neg258.9%
Simplified58.9%
*-commutative58.9%
distribute-frac-neg258.9%
distribute-frac-neg58.9%
associate-*l/64.5%
Applied egg-rr64.5%
if -3.9999999999999997e159 < (/.f64 x y) < -2.0000000000000001e-101 or 4.00000000000000002e-41 < (/.f64 x y) < 2e30Initial program 99.6%
Taylor expanded in x around 0 86.1%
Taylor expanded in x around -inf 76.8%
Taylor expanded in z around inf 59.1%
associate-*l/78.2%
*-commutative78.2%
Simplified72.6%
if -2.0000000000000001e-101 < (/.f64 x y) < 4.00000000000000002e-41Initial program 99.0%
Taylor expanded in x around 0 79.5%
if 2e30 < (/.f64 x y) Initial program 99.9%
Taylor expanded in z around 0 58.5%
mul-1-neg58.5%
unsub-neg58.5%
*-rgt-identity58.5%
associate-/l*65.2%
distribute-lft-out--65.2%
Simplified65.2%
Taylor expanded in x around inf 65.2%
mul-1-neg65.2%
distribute-frac-neg265.2%
Simplified65.2%
Final simplification72.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x y) z)))
(if (<= (/ x y) -4e+159)
(/ t (/ y (- x)))
(if (<= (/ x y) -2e-101)
t_1
(if (<= (/ x y) 4e-41)
t
(if (<= (/ x y) 2e+30) t_1 (* (/ x y) (- t))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) * z;
double tmp;
if ((x / y) <= -4e+159) {
tmp = t / (y / -x);
} else if ((x / y) <= -2e-101) {
tmp = t_1;
} else if ((x / y) <= 4e-41) {
tmp = t;
} else if ((x / y) <= 2e+30) {
tmp = t_1;
} else {
tmp = (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) :: t_1
real(8) :: tmp
t_1 = (x / y) * z
if ((x / y) <= (-4d+159)) then
tmp = t / (y / -x)
else if ((x / y) <= (-2d-101)) then
tmp = t_1
else if ((x / y) <= 4d-41) then
tmp = t
else if ((x / y) <= 2d+30) then
tmp = t_1
else
tmp = (x / y) * -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) * z;
double tmp;
if ((x / y) <= -4e+159) {
tmp = t / (y / -x);
} else if ((x / y) <= -2e-101) {
tmp = t_1;
} else if ((x / y) <= 4e-41) {
tmp = t;
} else if ((x / y) <= 2e+30) {
tmp = t_1;
} else {
tmp = (x / y) * -t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) * z tmp = 0 if (x / y) <= -4e+159: tmp = t / (y / -x) elif (x / y) <= -2e-101: tmp = t_1 elif (x / y) <= 4e-41: tmp = t elif (x / y) <= 2e+30: tmp = t_1 else: tmp = (x / y) * -t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) * z) tmp = 0.0 if (Float64(x / y) <= -4e+159) tmp = Float64(t / Float64(y / Float64(-x))); elseif (Float64(x / y) <= -2e-101) tmp = t_1; elseif (Float64(x / y) <= 4e-41) tmp = t; elseif (Float64(x / y) <= 2e+30) tmp = t_1; else tmp = Float64(Float64(x / y) * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) * z; tmp = 0.0; if ((x / y) <= -4e+159) tmp = t / (y / -x); elseif ((x / y) <= -2e-101) tmp = t_1; elseif ((x / y) <= 4e-41) tmp = t; elseif ((x / y) <= 2e+30) tmp = t_1; else tmp = (x / y) * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -4e+159], N[(t / N[(y / (-x)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -2e-101], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 4e-41], t, If[LessEqual[N[(x / y), $MachinePrecision], 2e+30], t$95$1, N[(N[(x / y), $MachinePrecision] * (-t)), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot z\\
\mathbf{if}\;\frac{x}{y} \leq -4 \cdot 10^{+159}:\\
\;\;\;\;\frac{t}{\frac{y}{-x}}\\
\mathbf{elif}\;\frac{x}{y} \leq -2 \cdot 10^{-101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 4 \cdot 10^{-41}:\\
\;\;\;\;t\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -3.9999999999999997e159Initial program 85.9%
Taylor expanded in z around 0 64.5%
mul-1-neg64.5%
unsub-neg64.5%
*-rgt-identity64.5%
associate-/l*58.9%
distribute-lft-out--58.9%
Simplified58.9%
Taylor expanded in x around inf 58.9%
mul-1-neg58.9%
distribute-frac-neg258.9%
Simplified58.9%
associate-*r/64.5%
distribute-frac-neg264.5%
add-sqr-sqrt36.6%
sqrt-unprod40.4%
sqr-neg40.4%
sqrt-unprod0.7%
add-sqr-sqrt4.2%
associate-*r/15.5%
clear-num15.5%
un-div-inv15.5%
add-sqr-sqrt6.4%
sqrt-unprod41.8%
sqr-neg41.8%
sqrt-unprod32.4%
add-sqr-sqrt62.5%
Applied egg-rr62.5%
if -3.9999999999999997e159 < (/.f64 x y) < -2.0000000000000001e-101 or 4.00000000000000002e-41 < (/.f64 x y) < 2e30Initial program 99.6%
Taylor expanded in x around 0 86.1%
Taylor expanded in x around -inf 76.8%
Taylor expanded in z around inf 59.1%
associate-*l/78.2%
*-commutative78.2%
Simplified72.6%
if -2.0000000000000001e-101 < (/.f64 x y) < 4.00000000000000002e-41Initial program 99.0%
Taylor expanded in x around 0 79.5%
if 2e30 < (/.f64 x y) Initial program 99.9%
Taylor expanded in z around 0 58.5%
mul-1-neg58.5%
unsub-neg58.5%
*-rgt-identity58.5%
associate-/l*65.2%
distribute-lft-out--65.2%
Simplified65.2%
Taylor expanded in x around inf 65.2%
mul-1-neg65.2%
distribute-frac-neg265.2%
Simplified65.2%
Final simplification72.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x y) z)) (t_2 (/ t (/ y (- x)))))
(if (<= (/ x y) -4e+159)
t_2
(if (<= (/ x y) -2e-101)
t_1
(if (<= (/ x y) 4e-41) t (if (<= (/ x y) 2e+30) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) * z;
double t_2 = t / (y / -x);
double tmp;
if ((x / y) <= -4e+159) {
tmp = t_2;
} else if ((x / y) <= -2e-101) {
tmp = t_1;
} else if ((x / y) <= 4e-41) {
tmp = t;
} else if ((x / y) <= 2e+30) {
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 / y) * z
t_2 = t / (y / -x)
if ((x / y) <= (-4d+159)) then
tmp = t_2
else if ((x / y) <= (-2d-101)) then
tmp = t_1
else if ((x / y) <= 4d-41) then
tmp = t
else if ((x / y) <= 2d+30) 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 / y) * z;
double t_2 = t / (y / -x);
double tmp;
if ((x / y) <= -4e+159) {
tmp = t_2;
} else if ((x / y) <= -2e-101) {
tmp = t_1;
} else if ((x / y) <= 4e-41) {
tmp = t;
} else if ((x / y) <= 2e+30) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) * z t_2 = t / (y / -x) tmp = 0 if (x / y) <= -4e+159: tmp = t_2 elif (x / y) <= -2e-101: tmp = t_1 elif (x / y) <= 4e-41: tmp = t elif (x / y) <= 2e+30: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) * z) t_2 = Float64(t / Float64(y / Float64(-x))) tmp = 0.0 if (Float64(x / y) <= -4e+159) tmp = t_2; elseif (Float64(x / y) <= -2e-101) tmp = t_1; elseif (Float64(x / y) <= 4e-41) tmp = t; elseif (Float64(x / y) <= 2e+30) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) * z; t_2 = t / (y / -x); tmp = 0.0; if ((x / y) <= -4e+159) tmp = t_2; elseif ((x / y) <= -2e-101) tmp = t_1; elseif ((x / y) <= 4e-41) tmp = t; elseif ((x / y) <= 2e+30) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$2 = N[(t / N[(y / (-x)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -4e+159], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], -2e-101], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 4e-41], t, If[LessEqual[N[(x / y), $MachinePrecision], 2e+30], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot z\\
t_2 := \frac{t}{\frac{y}{-x}}\\
\mathbf{if}\;\frac{x}{y} \leq -4 \cdot 10^{+159}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{x}{y} \leq -2 \cdot 10^{-101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 4 \cdot 10^{-41}:\\
\;\;\;\;t\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 x y) < -3.9999999999999997e159 or 2e30 < (/.f64 x y) Initial program 94.7%
Taylor expanded in z around 0 60.7%
mul-1-neg60.7%
unsub-neg60.7%
*-rgt-identity60.7%
associate-/l*62.9%
distribute-lft-out--62.9%
Simplified62.9%
Taylor expanded in x around inf 62.9%
mul-1-neg62.9%
distribute-frac-neg262.9%
Simplified62.9%
associate-*r/60.7%
distribute-frac-neg260.7%
add-sqr-sqrt32.8%
sqrt-unprod34.6%
sqr-neg34.6%
sqrt-unprod1.6%
add-sqr-sqrt4.6%
associate-*r/9.8%
clear-num9.8%
un-div-inv9.8%
add-sqr-sqrt4.8%
sqrt-unprod37.3%
sqr-neg37.3%
sqrt-unprod32.3%
add-sqr-sqrt64.2%
Applied egg-rr64.2%
if -3.9999999999999997e159 < (/.f64 x y) < -2.0000000000000001e-101 or 4.00000000000000002e-41 < (/.f64 x y) < 2e30Initial program 99.6%
Taylor expanded in x around 0 86.1%
Taylor expanded in x around -inf 76.8%
Taylor expanded in z around inf 59.1%
associate-*l/78.2%
*-commutative78.2%
Simplified72.6%
if -2.0000000000000001e-101 < (/.f64 x y) < 4.00000000000000002e-41Initial program 99.0%
Taylor expanded in x around 0 79.5%
Final simplification72.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- z t) y))))
(if (<= (/ x y) -100.0)
t_1
(if (<= (/ x y) 4e-41)
(+ t (* x (/ z y)))
(if (<= (/ x y) 2e+30) (* (/ x y) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((z - t) / y);
double tmp;
if ((x / y) <= -100.0) {
tmp = t_1;
} else if ((x / y) <= 4e-41) {
tmp = t + (x * (z / y));
} else if ((x / y) <= 2e+30) {
tmp = (x / y) * z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((z - t) / y)
if ((x / y) <= (-100.0d0)) then
tmp = t_1
else if ((x / y) <= 4d-41) then
tmp = t + (x * (z / y))
else if ((x / y) <= 2d+30) then
tmp = (x / y) * z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((z - t) / y);
double tmp;
if ((x / y) <= -100.0) {
tmp = t_1;
} else if ((x / y) <= 4e-41) {
tmp = t + (x * (z / y));
} else if ((x / y) <= 2e+30) {
tmp = (x / y) * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((z - t) / y) tmp = 0 if (x / y) <= -100.0: tmp = t_1 elif (x / y) <= 4e-41: tmp = t + (x * (z / y)) elif (x / y) <= 2e+30: tmp = (x / y) * z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(z - t) / y)) tmp = 0.0 if (Float64(x / y) <= -100.0) tmp = t_1; elseif (Float64(x / y) <= 4e-41) tmp = Float64(t + Float64(x * Float64(z / y))); elseif (Float64(x / y) <= 2e+30) tmp = Float64(Float64(x / y) * z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((z - t) / y); tmp = 0.0; if ((x / y) <= -100.0) tmp = t_1; elseif ((x / y) <= 4e-41) tmp = t + (x * (z / y)); elseif ((x / y) <= 2e+30) tmp = (x / y) * z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -100.0], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 4e-41], N[(t + N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e+30], N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z - t}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -100:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 4 \cdot 10^{-41}:\\
\;\;\;\;t + x \cdot \frac{z}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+30}:\\
\;\;\;\;\frac{x}{y} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -100 or 2e30 < (/.f64 x y) Initial program 95.9%
Taylor expanded in x around 0 92.1%
Taylor expanded in x around -inf 91.0%
associate-/l*93.4%
*-commutative93.4%
Applied egg-rr93.4%
if -100 < (/.f64 x y) < 4.00000000000000002e-41Initial program 99.1%
Taylor expanded in z around inf 95.8%
associate-/l*96.6%
Simplified96.6%
if 4.00000000000000002e-41 < (/.f64 x y) < 2e30Initial program 99.7%
Taylor expanded in x around 0 94.3%
Taylor expanded in x around -inf 79.4%
Taylor expanded in z around inf 67.5%
associate-*l/79.2%
*-commutative79.2%
Simplified73.0%
Final simplification93.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- z t) y))))
(if (<= (/ x y) -2e-101)
t_1
(if (<= (/ x y) 4e-41)
(* t (- 1.0 (/ x y)))
(if (<= (/ x y) 2e+30) (* (/ x y) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((z - t) / y);
double tmp;
if ((x / y) <= -2e-101) {
tmp = t_1;
} else if ((x / y) <= 4e-41) {
tmp = t * (1.0 - (x / y));
} else if ((x / y) <= 2e+30) {
tmp = (x / y) * z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((z - t) / y)
if ((x / y) <= (-2d-101)) then
tmp = t_1
else if ((x / y) <= 4d-41) then
tmp = t * (1.0d0 - (x / y))
else if ((x / y) <= 2d+30) then
tmp = (x / y) * z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((z - t) / y);
double tmp;
if ((x / y) <= -2e-101) {
tmp = t_1;
} else if ((x / y) <= 4e-41) {
tmp = t * (1.0 - (x / y));
} else if ((x / y) <= 2e+30) {
tmp = (x / y) * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((z - t) / y) tmp = 0 if (x / y) <= -2e-101: tmp = t_1 elif (x / y) <= 4e-41: tmp = t * (1.0 - (x / y)) elif (x / y) <= 2e+30: tmp = (x / y) * z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(z - t) / y)) tmp = 0.0 if (Float64(x / y) <= -2e-101) tmp = t_1; elseif (Float64(x / y) <= 4e-41) tmp = Float64(t * Float64(1.0 - Float64(x / y))); elseif (Float64(x / y) <= 2e+30) tmp = Float64(Float64(x / y) * z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((z - t) / y); tmp = 0.0; if ((x / y) <= -2e-101) tmp = t_1; elseif ((x / y) <= 4e-41) tmp = t * (1.0 - (x / y)); elseif ((x / y) <= 2e+30) tmp = (x / y) * z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -2e-101], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 4e-41], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e+30], N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z - t}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{-101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 4 \cdot 10^{-41}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+30}:\\
\;\;\;\;\frac{x}{y} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -2.0000000000000001e-101 or 2e30 < (/.f64 x y) Initial program 96.3%
Taylor expanded in x around 0 91.4%
Taylor expanded in x around -inf 89.0%
associate-/l*92.7%
*-commutative92.7%
Applied egg-rr92.7%
if -2.0000000000000001e-101 < (/.f64 x y) < 4.00000000000000002e-41Initial program 99.0%
Taylor expanded in z around 0 77.8%
mul-1-neg77.8%
unsub-neg77.8%
*-rgt-identity77.8%
associate-/l*79.5%
distribute-lft-out--79.5%
Simplified79.5%
if 4.00000000000000002e-41 < (/.f64 x y) < 2e30Initial program 99.7%
Taylor expanded in x around 0 94.3%
Taylor expanded in x around -inf 79.4%
Taylor expanded in z around inf 67.5%
associate-*l/79.2%
*-commutative79.2%
Simplified73.0%
Final simplification86.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2e+14) (not (<= (/ x y) 2e+30))) (* x (/ (- z t) y)) (+ t (* (/ x y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e+14) || !((x / y) <= 2e+30)) {
tmp = x * ((z - t) / y);
} else {
tmp = t + ((x / 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 (((x / y) <= (-2d+14)) .or. (.not. ((x / y) <= 2d+30))) then
tmp = x * ((z - t) / y)
else
tmp = t + ((x / y) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e+14) || !((x / y) <= 2e+30)) {
tmp = x * ((z - t) / y);
} else {
tmp = t + ((x / y) * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2e+14) or not ((x / y) <= 2e+30): tmp = x * ((z - t) / y) else: tmp = t + ((x / y) * z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2e+14) || !(Float64(x / y) <= 2e+30)) tmp = Float64(x * Float64(Float64(z - t) / y)); else tmp = Float64(t + Float64(Float64(x / y) * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2e+14) || ~(((x / y) <= 2e+30))) tmp = x * ((z - t) / y); else tmp = t + ((x / y) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2e+14], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e+30]], $MachinePrecision]], N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(t + N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+14} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{+30}\right):\\
\;\;\;\;x \cdot \frac{z - t}{y}\\
\mathbf{else}:\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\end{array}
\end{array}
if (/.f64 x y) < -2e14 or 2e30 < (/.f64 x y) Initial program 95.9%
Taylor expanded in x around 0 91.9%
Taylor expanded in x around -inf 91.9%
associate-/l*95.2%
*-commutative95.2%
Applied egg-rr95.2%
if -2e14 < (/.f64 x y) < 2e30Initial program 99.2%
Taylor expanded in x around 0 94.4%
Taylor expanded in z around inf 91.8%
associate-*l/95.3%
*-commutative95.3%
Simplified95.3%
Final simplification95.2%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -2e+14) (* x (/ (- z t) y)) (if (<= (/ x y) 200.0) (+ t (* (/ x y) z)) (/ (* x (- z t)) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e+14) {
tmp = x * ((z - t) / y);
} else if ((x / y) <= 200.0) {
tmp = t + ((x / y) * z);
} 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 ((x / y) <= (-2d+14)) then
tmp = x * ((z - t) / y)
else if ((x / y) <= 200.0d0) then
tmp = t + ((x / y) * z)
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 ((x / y) <= -2e+14) {
tmp = x * ((z - t) / y);
} else if ((x / y) <= 200.0) {
tmp = t + ((x / y) * z);
} else {
tmp = (x * (z - t)) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2e+14: tmp = x * ((z - t) / y) elif (x / y) <= 200.0: tmp = t + ((x / y) * z) else: tmp = (x * (z - t)) / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2e+14) tmp = Float64(x * Float64(Float64(z - t) / y)); elseif (Float64(x / y) <= 200.0) tmp = Float64(t + Float64(Float64(x / y) * z)); else tmp = Float64(Float64(x * Float64(z - t)) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2e+14) tmp = x * ((z - t) / y); elseif ((x / y) <= 200.0) tmp = t + ((x / y) * z); else tmp = (x * (z - t)) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2e+14], N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 200.0], N[(t + N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(z - t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \frac{z - t}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 200:\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(z - t\right)}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -2e14Initial program 92.2%
Taylor expanded in x around 0 90.7%
Taylor expanded in x around -inf 90.7%
associate-/l*95.4%
*-commutative95.4%
Applied egg-rr95.4%
if -2e14 < (/.f64 x y) < 200Initial program 99.2%
Taylor expanded in x around 0 94.1%
Taylor expanded in z around inf 93.6%
associate-*l/97.3%
*-commutative97.3%
Simplified97.3%
if 200 < (/.f64 x y) Initial program 99.8%
Taylor expanded in x around 0 94.0%
Taylor expanded in x around -inf 92.9%
Final simplification95.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2e-101) (not (<= (/ x y) 4e-41))) (* (/ x y) z) t))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e-101) || !((x / y) <= 4e-41)) {
tmp = (x / 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 (((x / y) <= (-2d-101)) .or. (.not. ((x / y) <= 4d-41))) then
tmp = (x / 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 (((x / y) <= -2e-101) || !((x / y) <= 4e-41)) {
tmp = (x / y) * z;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2e-101) or not ((x / y) <= 4e-41): tmp = (x / y) * z else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2e-101) || !(Float64(x / y) <= 4e-41)) tmp = Float64(Float64(x / y) * z); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2e-101) || ~(((x / y) <= 4e-41))) tmp = (x / y) * z; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2e-101], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4e-41]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{-101} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{-41}\right):\\
\;\;\;\;\frac{x}{y} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if (/.f64 x y) < -2.0000000000000001e-101 or 4.00000000000000002e-41 < (/.f64 x y) Initial program 96.7%
Taylor expanded in x around 0 91.7%
Taylor expanded in x around -inf 87.9%
Taylor expanded in z around inf 51.6%
associate-*l/59.4%
*-commutative59.4%
Simplified57.2%
if -2.0000000000000001e-101 < (/.f64 x y) < 4.00000000000000002e-41Initial program 99.0%
Taylor expanded in x around 0 79.5%
Final simplification66.3%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -2e-101) (/ z (/ y x)) (if (<= (/ x y) 4e-41) t (* (/ x y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e-101) {
tmp = z / (y / x);
} else if ((x / y) <= 4e-41) {
tmp = t;
} else {
tmp = (x / 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 ((x / y) <= (-2d-101)) then
tmp = z / (y / x)
else if ((x / y) <= 4d-41) then
tmp = t
else
tmp = (x / y) * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e-101) {
tmp = z / (y / x);
} else if ((x / y) <= 4e-41) {
tmp = t;
} else {
tmp = (x / y) * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2e-101: tmp = z / (y / x) elif (x / y) <= 4e-41: tmp = t else: tmp = (x / y) * z return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2e-101) tmp = Float64(z / Float64(y / x)); elseif (Float64(x / y) <= 4e-41) tmp = t; else tmp = Float64(Float64(x / y) * z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2e-101) tmp = z / (y / x); elseif ((x / y) <= 4e-41) tmp = t; else tmp = (x / y) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2e-101], N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4e-41], t, N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{-101}:\\
\;\;\;\;\frac{z}{\frac{y}{x}}\\
\mathbf{elif}\;\frac{x}{y} \leq 4 \cdot 10^{-41}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot z\\
\end{array}
\end{array}
if (/.f64 x y) < -2.0000000000000001e-101Initial program 93.8%
Taylor expanded in x around 0 90.1%
Taylor expanded in x around -inf 86.0%
Taylor expanded in z around inf 53.2%
associate-*l/66.3%
*-commutative66.3%
Simplified62.8%
clear-num62.8%
un-div-inv62.8%
Applied egg-rr62.8%
if -2.0000000000000001e-101 < (/.f64 x y) < 4.00000000000000002e-41Initial program 99.0%
Taylor expanded in x around 0 79.5%
if 4.00000000000000002e-41 < (/.f64 x y) Initial program 99.9%
Taylor expanded in x around 0 93.4%
Taylor expanded in x around -inf 89.8%
Taylor expanded in z around inf 49.9%
associate-*l/52.0%
*-commutative52.0%
Simplified51.2%
Final simplification66.3%
(FPCore (x y z t) :precision binary64 (if (<= z -1.08e+92) (* (/ x y) z) (if (<= z 6.1e+88) (* t (- 1.0 (/ x y))) (/ z (/ y x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.08e+92) {
tmp = (x / y) * z;
} else if (z <= 6.1e+88) {
tmp = t * (1.0 - (x / y));
} else {
tmp = z / (y / 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.08d+92)) then
tmp = (x / y) * z
else if (z <= 6.1d+88) then
tmp = t * (1.0d0 - (x / y))
else
tmp = z / (y / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.08e+92) {
tmp = (x / y) * z;
} else if (z <= 6.1e+88) {
tmp = t * (1.0 - (x / y));
} else {
tmp = z / (y / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.08e+92: tmp = (x / y) * z elif z <= 6.1e+88: tmp = t * (1.0 - (x / y)) else: tmp = z / (y / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.08e+92) tmp = Float64(Float64(x / y) * z); elseif (z <= 6.1e+88) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = Float64(z / Float64(y / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.08e+92) tmp = (x / y) * z; elseif (z <= 6.1e+88) tmp = t * (1.0 - (x / y)); else tmp = z / (y / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.08e+92], N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, 6.1e+88], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{+92}:\\
\;\;\;\;\frac{x}{y} \cdot z\\
\mathbf{elif}\;z \leq 6.1 \cdot 10^{+88}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{y}{x}}\\
\end{array}
\end{array}
if z < -1.08e92Initial program 98.0%
Taylor expanded in x around 0 92.5%
Taylor expanded in x around -inf 73.9%
Taylor expanded in z around inf 68.0%
associate-*l/90.2%
*-commutative90.2%
Simplified71.6%
if -1.08e92 < z < 6.0999999999999998e88Initial program 97.1%
Taylor expanded in z around 0 74.4%
mul-1-neg74.4%
unsub-neg74.4%
*-rgt-identity74.4%
associate-/l*76.6%
distribute-lft-out--76.6%
Simplified76.6%
if 6.0999999999999998e88 < z Initial program 99.8%
Taylor expanded in x around 0 86.4%
Taylor expanded in x around -inf 67.0%
Taylor expanded in z around inf 62.5%
associate-*l/95.3%
*-commutative95.3%
Simplified76.0%
clear-num76.0%
un-div-inv76.1%
Applied egg-rr76.1%
Final simplification75.6%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) (- INFINITY)) (* x (/ (- z t) y)) (+ t (* (/ x y) (- z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -((double) INFINITY)) {
tmp = x * ((z - t) / y);
} else {
tmp = t + ((x / y) * (z - t));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -Double.POSITIVE_INFINITY) {
tmp = x * ((z - t) / y);
} else {
tmp = t + ((x / y) * (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -math.inf: tmp = x * ((z - t) / y) else: tmp = t + ((x / y) * (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= Float64(-Inf)) tmp = Float64(x * Float64(Float64(z - t) / y)); else tmp = Float64(t + Float64(Float64(x / y) * Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -Inf) tmp = x * ((z - t) / y); else tmp = t + ((x / y) * (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], (-Infinity)], N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(t + N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -\infty:\\
\;\;\;\;x \cdot \frac{z - t}{y}\\
\mathbf{else}:\\
\;\;\;\;t + \frac{x}{y} \cdot \left(z - t\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -inf.0Initial program 76.8%
Taylor expanded in x around 0 99.9%
Taylor expanded in x around -inf 99.9%
associate-/l*100.0%
*-commutative100.0%
Applied egg-rr100.0%
if -inf.0 < (/.f64 x y) Initial program 99.4%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7.2e-100) (not (<= z 3.25e+19))) (* x (/ z y)) t))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.2e-100) || !(z <= 3.25e+19)) {
tmp = x * (z / y);
} 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 ((z <= (-7.2d-100)) .or. (.not. (z <= 3.25d+19))) then
tmp = x * (z / y)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.2e-100) || !(z <= 3.25e+19)) {
tmp = x * (z / y);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7.2e-100) or not (z <= 3.25e+19): tmp = x * (z / y) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7.2e-100) || !(z <= 3.25e+19)) tmp = Float64(x * Float64(z / y)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -7.2e-100) || ~((z <= 3.25e+19))) tmp = x * (z / y); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.2e-100], N[Not[LessEqual[z, 3.25e+19]], $MachinePrecision]], N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-100} \lor \neg \left(z \leq 3.25 \cdot 10^{+19}\right):\\
\;\;\;\;x \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -7.1999999999999997e-100 or 3.25e19 < z Initial program 98.6%
Taylor expanded in x around 0 91.2%
Taylor expanded in x around -inf 67.6%
Taylor expanded in z around inf 56.2%
associate-*r/53.9%
Simplified53.9%
if -7.1999999999999997e-100 < z < 3.25e19Initial program 96.2%
Taylor expanded in x around 0 48.1%
Final simplification51.6%
(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 97.7%
Taylor expanded in x around 0 35.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* (/ x y) (- z t)) t)))
(if (< z 2.759456554562692e-282)
t_1
(if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((x / y) * (z - t)) + t;
double tmp;
if (z < 2.759456554562692e-282) {
tmp = t_1;
} else if (z < 2.326994450874436e-110) {
tmp = (x * ((z - t) / y)) + 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 = ((x / y) * (z - t)) + t
if (z < 2.759456554562692d-282) then
tmp = t_1
else if (z < 2.326994450874436d-110) then
tmp = (x * ((z - t) / y)) + 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 = ((x / y) * (z - t)) + t;
double tmp;
if (z < 2.759456554562692e-282) {
tmp = t_1;
} else if (z < 2.326994450874436e-110) {
tmp = (x * ((z - t) / y)) + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((x / y) * (z - t)) + t tmp = 0 if z < 2.759456554562692e-282: tmp = t_1 elif z < 2.326994450874436e-110: tmp = (x * ((z - t) / y)) + t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(x / y) * Float64(z - t)) + t) tmp = 0.0 if (z < 2.759456554562692e-282) tmp = t_1; elseif (z < 2.326994450874436e-110) tmp = Float64(Float64(x * Float64(Float64(z - t) / y)) + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((x / y) * (z - t)) + t; tmp = 0.0; if (z < 2.759456554562692e-282) tmp = t_1; elseif (z < 2.326994450874436e-110) tmp = (x * ((z - t) / y)) + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, If[Less[z, 2.759456554562692e-282], t$95$1, If[Less[z, 2.326994450874436e-110], N[(N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot \left(z - t\right) + t\\
\mathbf{if}\;z < 2.759456554562692 \cdot 10^{-282}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 2.326994450874436 \cdot 10^{-110}:\\
\;\;\;\;x \cdot \frac{z - t}{y} + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024100
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
:precision binary64
:alt
(if (< z 2.759456554562692e-282) (+ (* (/ x y) (- z t)) t) (if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t)))
(+ (* (/ x y) (- z t)) t))