
(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 14 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 (* (/ (- 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}
Initial program 96.4%
Final simplification96.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.12e+137)
t
(if (<= y -2.6e+68)
(/ (- y) (/ z t))
(if (<= y -1.5e+17)
t
(if (<= y 19000000000000.0) (* x (/ t (- z y))) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.12e+137) {
tmp = t;
} else if (y <= -2.6e+68) {
tmp = -y / (z / t);
} else if (y <= -1.5e+17) {
tmp = t;
} else if (y <= 19000000000000.0) {
tmp = x * (t / (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 (y <= (-1.12d+137)) then
tmp = t
else if (y <= (-2.6d+68)) then
tmp = -y / (z / t)
else if (y <= (-1.5d+17)) then
tmp = t
else if (y <= 19000000000000.0d0) then
tmp = x * (t / (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 (y <= -1.12e+137) {
tmp = t;
} else if (y <= -2.6e+68) {
tmp = -y / (z / t);
} else if (y <= -1.5e+17) {
tmp = t;
} else if (y <= 19000000000000.0) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.12e+137: tmp = t elif y <= -2.6e+68: tmp = -y / (z / t) elif y <= -1.5e+17: tmp = t elif y <= 19000000000000.0: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.12e+137) tmp = t; elseif (y <= -2.6e+68) tmp = Float64(Float64(-y) / Float64(z / t)); elseif (y <= -1.5e+17) tmp = t; elseif (y <= 19000000000000.0) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.12e+137) tmp = t; elseif (y <= -2.6e+68) tmp = -y / (z / t); elseif (y <= -1.5e+17) tmp = t; elseif (y <= 19000000000000.0) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.12e+137], t, If[LessEqual[y, -2.6e+68], N[((-y) / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.5e+17], t, If[LessEqual[y, 19000000000000.0], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{+137}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -2.6 \cdot 10^{+68}:\\
\;\;\;\;\frac{-y}{\frac{z}{t}}\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{+17}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 19000000000000:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.1200000000000001e137 or -2.5999999999999998e68 < y < -1.5e17 or 1.9e13 < y Initial program 99.8%
associate-*l/72.1%
associate-*r/79.5%
Simplified79.5%
Taylor expanded in y around inf 62.3%
if -1.1200000000000001e137 < y < -2.5999999999999998e68Initial program 99.9%
associate-*l/93.3%
associate-*r/87.0%
Simplified87.0%
Taylor expanded in x around 0 67.9%
mul-1-neg67.9%
associate-*r/61.7%
distribute-lft-neg-out61.7%
*-commutative61.7%
Simplified61.7%
Taylor expanded in z around inf 48.7%
mul-1-neg48.7%
associate-/l*54.9%
Simplified54.9%
if -1.5e17 < y < 1.9e13Initial program 93.5%
associate-*l/95.3%
associate-*r/91.3%
Simplified91.3%
Taylor expanded in x around inf 77.2%
associate-*l/73.5%
*-commutative73.5%
Simplified73.5%
Final simplification68.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.3e+109)
t
(if (<= y -3.5e+68)
(* (- x y) (/ t z))
(if (<= y -2.6e+18)
t
(if (<= y 20000000000000.0) (* x (/ t (- z y))) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.3e+109) {
tmp = t;
} else if (y <= -3.5e+68) {
tmp = (x - y) * (t / z);
} else if (y <= -2.6e+18) {
tmp = t;
} else if (y <= 20000000000000.0) {
tmp = x * (t / (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 (y <= (-2.3d+109)) then
tmp = t
else if (y <= (-3.5d+68)) then
tmp = (x - y) * (t / z)
else if (y <= (-2.6d+18)) then
tmp = t
else if (y <= 20000000000000.0d0) then
tmp = x * (t / (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 (y <= -2.3e+109) {
tmp = t;
} else if (y <= -3.5e+68) {
tmp = (x - y) * (t / z);
} else if (y <= -2.6e+18) {
tmp = t;
} else if (y <= 20000000000000.0) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.3e+109: tmp = t elif y <= -3.5e+68: tmp = (x - y) * (t / z) elif y <= -2.6e+18: tmp = t elif y <= 20000000000000.0: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.3e+109) tmp = t; elseif (y <= -3.5e+68) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (y <= -2.6e+18) tmp = t; elseif (y <= 20000000000000.0) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.3e+109) tmp = t; elseif (y <= -3.5e+68) tmp = (x - y) * (t / z); elseif (y <= -2.6e+18) tmp = t; elseif (y <= 20000000000000.0) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.3e+109], t, If[LessEqual[y, -3.5e+68], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.6e+18], t, If[LessEqual[y, 20000000000000.0], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+109}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{+68}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq -2.6 \cdot 10^{+18}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 20000000000000:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.3000000000000001e109 or -3.49999999999999977e68 < y < -2.6e18 or 2e13 < y Initial program 99.8%
associate-*l/73.4%
associate-*r/79.5%
Simplified79.5%
Taylor expanded in y around inf 61.4%
if -2.3000000000000001e109 < y < -3.49999999999999977e68Initial program 99.8%
associate-*l/90.1%
associate-*r/90.2%
Simplified90.2%
Taylor expanded in z around inf 74.3%
if -2.6e18 < y < 2e13Initial program 93.5%
associate-*l/95.3%
associate-*r/91.3%
Simplified91.3%
Taylor expanded in x around inf 77.2%
associate-*l/73.5%
*-commutative73.5%
Simplified73.5%
Final simplification68.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.75e+109)
t
(if (<= y -1.35e+68)
(* (- x y) (/ t z))
(if (<= y -1.6e+16) t (if (<= y 1.36e+88) (* t (/ x (- z y))) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.75e+109) {
tmp = t;
} else if (y <= -1.35e+68) {
tmp = (x - y) * (t / z);
} else if (y <= -1.6e+16) {
tmp = t;
} else if (y <= 1.36e+88) {
tmp = t * (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 (y <= (-1.75d+109)) then
tmp = t
else if (y <= (-1.35d+68)) then
tmp = (x - y) * (t / z)
else if (y <= (-1.6d+16)) then
tmp = t
else if (y <= 1.36d+88) then
tmp = t * (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 (y <= -1.75e+109) {
tmp = t;
} else if (y <= -1.35e+68) {
tmp = (x - y) * (t / z);
} else if (y <= -1.6e+16) {
tmp = t;
} else if (y <= 1.36e+88) {
tmp = t * (x / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.75e+109: tmp = t elif y <= -1.35e+68: tmp = (x - y) * (t / z) elif y <= -1.6e+16: tmp = t elif y <= 1.36e+88: tmp = t * (x / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.75e+109) tmp = t; elseif (y <= -1.35e+68) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (y <= -1.6e+16) tmp = t; elseif (y <= 1.36e+88) tmp = Float64(t * Float64(x / Float64(z - y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.75e+109) tmp = t; elseif (y <= -1.35e+68) tmp = (x - y) * (t / z); elseif (y <= -1.6e+16) tmp = t; elseif (y <= 1.36e+88) tmp = t * (x / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.75e+109], t, If[LessEqual[y, -1.35e+68], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.6e+16], t, If[LessEqual[y, 1.36e+88], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+109}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{+68}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq -1.6 \cdot 10^{+16}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.36 \cdot 10^{+88}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.74999999999999992e109 or -1.34999999999999995e68 < y < -1.6e16 or 1.3600000000000001e88 < y Initial program 99.8%
associate-*l/72.8%
associate-*r/77.0%
Simplified77.0%
Taylor expanded in y around inf 65.0%
if -1.74999999999999992e109 < y < -1.34999999999999995e68Initial program 99.8%
associate-*l/90.1%
associate-*r/90.2%
Simplified90.2%
Taylor expanded in z around inf 74.3%
if -1.6e16 < y < 1.3600000000000001e88Initial program 94.2%
Taylor expanded in x around inf 74.0%
Final simplification70.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ y (- y z)))))
(if (<= y -2.8e+68)
t_1
(if (<= y -5.8e-34)
(- t (* t (/ x y)))
(if (<= y -2.5e-95)
(* t (/ (- x y) z))
(if (<= y 18000000000000.0) (* t (/ x (- z y))) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (y / (y - z));
double tmp;
if (y <= -2.8e+68) {
tmp = t_1;
} else if (y <= -5.8e-34) {
tmp = t - (t * (x / y));
} else if (y <= -2.5e-95) {
tmp = t * ((x - y) / z);
} else if (y <= 18000000000000.0) {
tmp = t * (x / (z - y));
} 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 = t * (y / (y - z))
if (y <= (-2.8d+68)) then
tmp = t_1
else if (y <= (-5.8d-34)) then
tmp = t - (t * (x / y))
else if (y <= (-2.5d-95)) then
tmp = t * ((x - y) / z)
else if (y <= 18000000000000.0d0) then
tmp = t * (x / (z - y))
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 = t * (y / (y - z));
double tmp;
if (y <= -2.8e+68) {
tmp = t_1;
} else if (y <= -5.8e-34) {
tmp = t - (t * (x / y));
} else if (y <= -2.5e-95) {
tmp = t * ((x - y) / z);
} else if (y <= 18000000000000.0) {
tmp = t * (x / (z - y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (y / (y - z)) tmp = 0 if y <= -2.8e+68: tmp = t_1 elif y <= -5.8e-34: tmp = t - (t * (x / y)) elif y <= -2.5e-95: tmp = t * ((x - y) / z) elif y <= 18000000000000.0: tmp = t * (x / (z - y)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(y / Float64(y - z))) tmp = 0.0 if (y <= -2.8e+68) tmp = t_1; elseif (y <= -5.8e-34) tmp = Float64(t - Float64(t * Float64(x / y))); elseif (y <= -2.5e-95) tmp = Float64(t * Float64(Float64(x - y) / z)); elseif (y <= 18000000000000.0) tmp = Float64(t * Float64(x / Float64(z - y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (y / (y - z)); tmp = 0.0; if (y <= -2.8e+68) tmp = t_1; elseif (y <= -5.8e-34) tmp = t - (t * (x / y)); elseif (y <= -2.5e-95) tmp = t * ((x - y) / z); elseif (y <= 18000000000000.0) tmp = t * (x / (z - y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.8e+68], t$95$1, If[LessEqual[y, -5.8e-34], N[(t - N[(t * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.5e-95], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 18000000000000.0], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{y - z}\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{+68}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -5.8 \cdot 10^{-34}:\\
\;\;\;\;t - t \cdot \frac{x}{y}\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-95}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\mathbf{elif}\;y \leq 18000000000000:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.8e68 or 1.8e13 < y Initial program 99.8%
Taylor expanded in x around 0 77.4%
neg-mul-177.4%
distribute-neg-frac77.4%
Simplified77.4%
frac-2neg77.4%
div-inv77.3%
remove-double-neg77.3%
sub-neg77.3%
distribute-neg-in77.3%
remove-double-neg77.3%
Applied egg-rr77.3%
associate-*r/77.4%
*-rgt-identity77.4%
+-commutative77.4%
unsub-neg77.4%
Simplified77.4%
if -2.8e68 < y < -5.8000000000000004e-34Initial program 99.8%
Taylor expanded in z around 0 89.6%
associate-*r/89.6%
neg-mul-189.6%
neg-sub089.6%
associate--r-89.6%
neg-sub089.6%
Simplified89.6%
Taylor expanded in x around 0 84.9%
mul-1-neg84.9%
associate-/l*89.6%
unsub-neg89.6%
associate-/l*84.9%
associate-*r/89.7%
Simplified89.7%
if -5.8000000000000004e-34 < y < -2.4999999999999999e-95Initial program 99.6%
Taylor expanded in z around inf 75.0%
if -2.4999999999999999e-95 < y < 1.8e13Initial program 92.5%
Taylor expanded in x around inf 81.0%
Final simplification79.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ y (- y z)))))
(if (<= y -1.85e+68)
t_1
(if (<= y -1.26e-33)
(- t (* t (/ x y)))
(if (<= y -2.5e-95)
(* t (/ (- x y) z))
(if (<= y 4.4e-11) (/ (* x t) (- z y)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (y / (y - z));
double tmp;
if (y <= -1.85e+68) {
tmp = t_1;
} else if (y <= -1.26e-33) {
tmp = t - (t * (x / y));
} else if (y <= -2.5e-95) {
tmp = t * ((x - y) / z);
} else if (y <= 4.4e-11) {
tmp = (x * t) / (z - y);
} 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 = t * (y / (y - z))
if (y <= (-1.85d+68)) then
tmp = t_1
else if (y <= (-1.26d-33)) then
tmp = t - (t * (x / y))
else if (y <= (-2.5d-95)) then
tmp = t * ((x - y) / z)
else if (y <= 4.4d-11) then
tmp = (x * t) / (z - y)
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 = t * (y / (y - z));
double tmp;
if (y <= -1.85e+68) {
tmp = t_1;
} else if (y <= -1.26e-33) {
tmp = t - (t * (x / y));
} else if (y <= -2.5e-95) {
tmp = t * ((x - y) / z);
} else if (y <= 4.4e-11) {
tmp = (x * t) / (z - y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (y / (y - z)) tmp = 0 if y <= -1.85e+68: tmp = t_1 elif y <= -1.26e-33: tmp = t - (t * (x / y)) elif y <= -2.5e-95: tmp = t * ((x - y) / z) elif y <= 4.4e-11: tmp = (x * t) / (z - y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(y / Float64(y - z))) tmp = 0.0 if (y <= -1.85e+68) tmp = t_1; elseif (y <= -1.26e-33) tmp = Float64(t - Float64(t * Float64(x / y))); elseif (y <= -2.5e-95) tmp = Float64(t * Float64(Float64(x - y) / z)); elseif (y <= 4.4e-11) tmp = Float64(Float64(x * t) / Float64(z - y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (y / (y - z)); tmp = 0.0; if (y <= -1.85e+68) tmp = t_1; elseif (y <= -1.26e-33) tmp = t - (t * (x / y)); elseif (y <= -2.5e-95) tmp = t * ((x - y) / z); elseif (y <= 4.4e-11) tmp = (x * t) / (z - y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.85e+68], t$95$1, If[LessEqual[y, -1.26e-33], N[(t - N[(t * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.5e-95], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.4e-11], N[(N[(x * t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{y - z}\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{+68}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.26 \cdot 10^{-33}:\\
\;\;\;\;t - t \cdot \frac{x}{y}\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-95}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-11}:\\
\;\;\;\;\frac{x \cdot t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.84999999999999999e68 or 4.4000000000000003e-11 < y Initial program 99.8%
Taylor expanded in x around 0 74.9%
neg-mul-174.9%
distribute-neg-frac74.9%
Simplified74.9%
frac-2neg74.9%
div-inv74.9%
remove-double-neg74.9%
sub-neg74.9%
distribute-neg-in74.9%
remove-double-neg74.9%
Applied egg-rr74.9%
associate-*r/74.9%
*-rgt-identity74.9%
+-commutative74.9%
unsub-neg74.9%
Simplified74.9%
if -1.84999999999999999e68 < y < -1.26000000000000005e-33Initial program 99.8%
Taylor expanded in z around 0 89.6%
associate-*r/89.6%
neg-mul-189.6%
neg-sub089.6%
associate--r-89.6%
neg-sub089.6%
Simplified89.6%
Taylor expanded in x around 0 84.9%
mul-1-neg84.9%
associate-/l*89.6%
unsub-neg89.6%
associate-/l*84.9%
associate-*r/89.7%
Simplified89.7%
if -1.26000000000000005e-33 < y < -2.4999999999999999e-95Initial program 99.6%
Taylor expanded in z around inf 75.0%
if -2.4999999999999999e-95 < y < 4.4000000000000003e-11Initial program 92.0%
associate-*l/95.9%
associate-*r/90.9%
Simplified90.9%
Taylor expanded in x around inf 84.3%
Final simplification80.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.12e+137)
t
(if (<= y -3.8e+68)
(/ (- y) (/ z t))
(if (<= y -1.2e-25) t (if (<= y 3.2e-12) (/ (* x t) z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.12e+137) {
tmp = t;
} else if (y <= -3.8e+68) {
tmp = -y / (z / t);
} else if (y <= -1.2e-25) {
tmp = t;
} else if (y <= 3.2e-12) {
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 <= (-1.12d+137)) then
tmp = t
else if (y <= (-3.8d+68)) then
tmp = -y / (z / t)
else if (y <= (-1.2d-25)) then
tmp = t
else if (y <= 3.2d-12) 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 <= -1.12e+137) {
tmp = t;
} else if (y <= -3.8e+68) {
tmp = -y / (z / t);
} else if (y <= -1.2e-25) {
tmp = t;
} else if (y <= 3.2e-12) {
tmp = (x * t) / z;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.12e+137: tmp = t elif y <= -3.8e+68: tmp = -y / (z / t) elif y <= -1.2e-25: tmp = t elif y <= 3.2e-12: tmp = (x * t) / z else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.12e+137) tmp = t; elseif (y <= -3.8e+68) tmp = Float64(Float64(-y) / Float64(z / t)); elseif (y <= -1.2e-25) tmp = t; elseif (y <= 3.2e-12) tmp = Float64(Float64(x * t) / z); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.12e+137) tmp = t; elseif (y <= -3.8e+68) tmp = -y / (z / t); elseif (y <= -1.2e-25) tmp = t; elseif (y <= 3.2e-12) tmp = (x * t) / z; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.12e+137], t, If[LessEqual[y, -3.8e+68], N[((-y) / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.2e-25], t, If[LessEqual[y, 3.2e-12], N[(N[(x * t), $MachinePrecision] / z), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{+137}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{+68}:\\
\;\;\;\;\frac{-y}{\frac{z}{t}}\\
\mathbf{elif}\;y \leq -1.2 \cdot 10^{-25}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-12}:\\
\;\;\;\;\frac{x \cdot t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.1200000000000001e137 or -3.8000000000000001e68 < y < -1.20000000000000005e-25 or 3.2000000000000001e-12 < y Initial program 99.8%
associate-*l/74.2%
associate-*r/81.5%
Simplified81.5%
Taylor expanded in y around inf 59.1%
if -1.1200000000000001e137 < y < -3.8000000000000001e68Initial program 99.9%
associate-*l/93.3%
associate-*r/87.0%
Simplified87.0%
Taylor expanded in x around 0 67.9%
mul-1-neg67.9%
associate-*r/61.7%
distribute-lft-neg-out61.7%
*-commutative61.7%
Simplified61.7%
Taylor expanded in z around inf 48.7%
mul-1-neg48.7%
associate-/l*54.9%
Simplified54.9%
if -1.20000000000000005e-25 < y < 3.2000000000000001e-12Initial program 92.7%
associate-*l/96.3%
associate-*r/91.0%
Simplified91.0%
Taylor expanded in y around 0 68.2%
Final simplification63.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6.1e+206) (not (<= y 1.7e+124))) (* t (/ y (- y z))) (* (- x y) (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.1e+206) || !(y <= 1.7e+124)) {
tmp = t * (y / (y - z));
} else {
tmp = (x - y) * (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 <= (-6.1d+206)) .or. (.not. (y <= 1.7d+124))) then
tmp = t * (y / (y - z))
else
tmp = (x - y) * (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 <= -6.1e+206) || !(y <= 1.7e+124)) {
tmp = t * (y / (y - z));
} else {
tmp = (x - y) * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6.1e+206) or not (y <= 1.7e+124): tmp = t * (y / (y - z)) else: tmp = (x - y) * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6.1e+206) || !(y <= 1.7e+124)) tmp = Float64(t * Float64(y / Float64(y - z))); else tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -6.1e+206) || ~((y <= 1.7e+124))) tmp = t * (y / (y - z)); else tmp = (x - y) * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.1e+206], N[Not[LessEqual[y, 1.7e+124]], $MachinePrecision]], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.1 \cdot 10^{+206} \lor \neg \left(y \leq 1.7 \cdot 10^{+124}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -6.09999999999999967e206 or 1.7e124 < y Initial program 99.8%
Taylor expanded in x around 0 87.7%
neg-mul-187.7%
distribute-neg-frac87.7%
Simplified87.7%
frac-2neg87.7%
div-inv87.6%
remove-double-neg87.6%
sub-neg87.6%
distribute-neg-in87.6%
remove-double-neg87.6%
Applied egg-rr87.6%
associate-*r/87.7%
*-rgt-identity87.7%
+-commutative87.7%
unsub-neg87.7%
Simplified87.7%
if -6.09999999999999967e206 < y < 1.7e124Initial program 95.5%
associate-*l/90.7%
associate-*r/91.1%
Simplified91.1%
Final simplification90.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.8e+14) (not (<= y 20000000000000.0))) (* t (/ y (- y z))) (* t (/ x (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.8e+14) || !(y <= 20000000000000.0)) {
tmp = t * (y / (y - z));
} else {
tmp = t * (x / (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 <= (-3.8d+14)) .or. (.not. (y <= 20000000000000.0d0))) then
tmp = t * (y / (y - z))
else
tmp = t * (x / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.8e+14) || !(y <= 20000000000000.0)) {
tmp = t * (y / (y - z));
} else {
tmp = t * (x / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.8e+14) or not (y <= 20000000000000.0): tmp = t * (y / (y - z)) else: tmp = t * (x / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.8e+14) || !(y <= 20000000000000.0)) tmp = Float64(t * Float64(y / Float64(y - z))); else tmp = Float64(t * Float64(x / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.8e+14) || ~((y <= 20000000000000.0))) tmp = t * (y / (y - z)); else tmp = t * (x / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.8e+14], N[Not[LessEqual[y, 20000000000000.0]], $MachinePrecision]], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{+14} \lor \neg \left(y \leq 20000000000000\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\end{array}
\end{array}
if y < -3.8e14 or 2e13 < y Initial program 99.8%
Taylor expanded in x around 0 77.8%
neg-mul-177.8%
distribute-neg-frac77.8%
Simplified77.8%
frac-2neg77.8%
div-inv77.7%
remove-double-neg77.7%
sub-neg77.7%
distribute-neg-in77.7%
remove-double-neg77.7%
Applied egg-rr77.7%
associate-*r/77.8%
*-rgt-identity77.8%
+-commutative77.8%
unsub-neg77.8%
Simplified77.8%
if -3.8e14 < y < 2e13Initial program 93.5%
Taylor expanded in x around inf 77.7%
Final simplification77.7%
(FPCore (x y z t) :precision binary64 (if (<= y -4e-34) t (if (<= y 1.05e-56) (* y (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4e-34) {
tmp = t;
} else if (y <= 1.05e-56) {
tmp = y * (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 <= (-4d-34)) then
tmp = t
else if (y <= 1.05d-56) then
tmp = y * (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 <= -4e-34) {
tmp = t;
} else if (y <= 1.05e-56) {
tmp = y * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4e-34: tmp = t elif y <= 1.05e-56: tmp = y * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4e-34) tmp = t; elseif (y <= 1.05e-56) tmp = Float64(y * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4e-34) tmp = t; elseif (y <= 1.05e-56) tmp = y * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4e-34], t, If[LessEqual[y, 1.05e-56], N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{-34}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-56}:\\
\;\;\;\;y \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.99999999999999971e-34 or 1.05000000000000003e-56 < y Initial program 99.8%
associate-*l/77.8%
associate-*r/82.5%
Simplified82.5%
Taylor expanded in y around inf 51.1%
if -3.99999999999999971e-34 < y < 1.05000000000000003e-56Initial program 92.2%
associate-*l/96.0%
associate-*r/91.1%
Simplified91.1%
Taylor expanded in x around 0 32.3%
mul-1-neg32.3%
associate-*r/37.0%
distribute-lft-neg-out37.0%
*-commutative37.0%
Simplified37.0%
Taylor expanded in z around inf 30.7%
expm1-log1p-u28.7%
expm1-udef20.0%
add-sqr-sqrt8.7%
sqrt-unprod19.0%
sqr-neg19.0%
sqrt-unprod13.8%
add-sqr-sqrt21.7%
*-commutative21.7%
Applied egg-rr21.7%
expm1-def21.8%
expm1-log1p24.8%
Simplified24.8%
Final simplification39.4%
(FPCore (x y z t) :precision binary64 (if (<= y -1.52e-25) t (if (<= y 6.8e-12) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.52e-25) {
tmp = t;
} else if (y <= 6.8e-12) {
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 <= (-1.52d-25)) then
tmp = t
else if (y <= 6.8d-12) 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 <= -1.52e-25) {
tmp = t;
} else if (y <= 6.8e-12) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.52e-25: tmp = t elif y <= 6.8e-12: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.52e-25) tmp = t; elseif (y <= 6.8e-12) 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 <= -1.52e-25) tmp = t; elseif (y <= 6.8e-12) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.52e-25], t, If[LessEqual[y, 6.8e-12], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.52 \cdot 10^{-25}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{-12}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.52000000000000006e-25 or 6.8000000000000001e-12 < y Initial program 99.8%
associate-*l/76.4%
associate-*r/82.1%
Simplified82.1%
Taylor expanded in y around inf 54.3%
if -1.52000000000000006e-25 < y < 6.8000000000000001e-12Initial program 92.7%
clear-num90.4%
associate-/r/92.7%
Applied egg-rr92.7%
Taylor expanded in y around 0 68.2%
associate-/l*65.2%
associate-/r/64.4%
Simplified64.4%
Final simplification59.2%
(FPCore (x y z t) :precision binary64 (if (<= y -1.52e-25) t (if (<= y 2.4e-21) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.52e-25) {
tmp = t;
} else if (y <= 2.4e-21) {
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 <= (-1.52d-25)) then
tmp = t
else if (y <= 2.4d-21) 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 <= -1.52e-25) {
tmp = t;
} else if (y <= 2.4e-21) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.52e-25: tmp = t elif y <= 2.4e-21: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.52e-25) tmp = t; elseif (y <= 2.4e-21) 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 <= -1.52e-25) tmp = t; elseif (y <= 2.4e-21) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.52e-25], t, If[LessEqual[y, 2.4e-21], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.52 \cdot 10^{-25}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-21}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.52000000000000006e-25 or 2.3999999999999999e-21 < y Initial program 99.8%
associate-*l/76.4%
associate-*r/82.1%
Simplified82.1%
Taylor expanded in y around inf 54.3%
if -1.52000000000000006e-25 < y < 2.3999999999999999e-21Initial program 92.7%
Taylor expanded in y around 0 67.1%
Final simplification60.5%
(FPCore (x y z t) :precision binary64 (if (<= y -1.25e-25) t (if (<= y 1.05e-12) (/ (* x t) z) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.25e-25) {
tmp = t;
} else if (y <= 1.05e-12) {
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 <= (-1.25d-25)) then
tmp = t
else if (y <= 1.05d-12) 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 <= -1.25e-25) {
tmp = t;
} else if (y <= 1.05e-12) {
tmp = (x * t) / z;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.25e-25: tmp = t elif y <= 1.05e-12: tmp = (x * t) / z else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.25e-25) tmp = t; elseif (y <= 1.05e-12) tmp = Float64(Float64(x * t) / z); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.25e-25) tmp = t; elseif (y <= 1.05e-12) tmp = (x * t) / z; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.25e-25], t, If[LessEqual[y, 1.05e-12], N[(N[(x * t), $MachinePrecision] / z), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-25}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-12}:\\
\;\;\;\;\frac{x \cdot t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.2499999999999999e-25 or 1.04999999999999997e-12 < y Initial program 99.8%
associate-*l/76.4%
associate-*r/82.1%
Simplified82.1%
Taylor expanded in y around inf 54.3%
if -1.2499999999999999e-25 < y < 1.04999999999999997e-12Initial program 92.7%
associate-*l/96.3%
associate-*r/91.0%
Simplified91.0%
Taylor expanded in y around 0 68.2%
Final simplification61.0%
(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/85.9%
associate-*r/86.3%
Simplified86.3%
Taylor expanded in y around inf 31.9%
Final simplification31.9%
(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 2023200
(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))