
(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 13 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 97.1%
Final simplification97.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ x (- z y)))))
(if (<= y -1.65e+148)
t
(if (<= y -1.8e+117)
t_1
(if (<= y -1.02e+86)
t
(if (<= y -2.1e-26)
(* (- x y) (/ t z))
(if (<= y 6.8e+72) t_1 t)))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (x / (z - y));
double tmp;
if (y <= -1.65e+148) {
tmp = t;
} else if (y <= -1.8e+117) {
tmp = t_1;
} else if (y <= -1.02e+86) {
tmp = t;
} else if (y <= -2.1e-26) {
tmp = (x - y) * (t / z);
} else if (y <= 6.8e+72) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = t * (x / (z - y))
if (y <= (-1.65d+148)) then
tmp = t
else if (y <= (-1.8d+117)) then
tmp = t_1
else if (y <= (-1.02d+86)) then
tmp = t
else if (y <= (-2.1d-26)) then
tmp = (x - y) * (t / z)
else if (y <= 6.8d+72) then
tmp = t_1
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t * (x / (z - y));
double tmp;
if (y <= -1.65e+148) {
tmp = t;
} else if (y <= -1.8e+117) {
tmp = t_1;
} else if (y <= -1.02e+86) {
tmp = t;
} else if (y <= -2.1e-26) {
tmp = (x - y) * (t / z);
} else if (y <= 6.8e+72) {
tmp = t_1;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (x / (z - y)) tmp = 0 if y <= -1.65e+148: tmp = t elif y <= -1.8e+117: tmp = t_1 elif y <= -1.02e+86: tmp = t elif y <= -2.1e-26: tmp = (x - y) * (t / z) elif y <= 6.8e+72: tmp = t_1 else: tmp = t return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(x / Float64(z - y))) tmp = 0.0 if (y <= -1.65e+148) tmp = t; elseif (y <= -1.8e+117) tmp = t_1; elseif (y <= -1.02e+86) tmp = t; elseif (y <= -2.1e-26) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (y <= 6.8e+72) tmp = t_1; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (x / (z - y)); tmp = 0.0; if (y <= -1.65e+148) tmp = t; elseif (y <= -1.8e+117) tmp = t_1; elseif (y <= -1.02e+86) tmp = t; elseif (y <= -2.1e-26) tmp = (x - y) * (t / z); elseif (y <= 6.8e+72) tmp = t_1; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.65e+148], t, If[LessEqual[y, -1.8e+117], t$95$1, If[LessEqual[y, -1.02e+86], t, If[LessEqual[y, -2.1e-26], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+72], t$95$1, t]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{x}{z - y}\\
\mathbf{if}\;y \leq -1.65 \cdot 10^{+148}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{+117}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.02 \cdot 10^{+86}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-26}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.65000000000000005e148 or -1.80000000000000006e117 < y < -1.01999999999999996e86 or 6.7999999999999997e72 < y Initial program 100.0%
associate-*l/61.1%
associate-/l*81.8%
Simplified81.8%
Taylor expanded in y around inf 80.6%
if -1.65000000000000005e148 < y < -1.80000000000000006e117 or -2.10000000000000008e-26 < y < 6.7999999999999997e72Initial program 95.1%
Taylor expanded in x around inf 76.0%
if -1.01999999999999996e86 < y < -2.10000000000000008e-26Initial program 98.2%
associate-*l/82.2%
associate-/l*88.4%
Simplified88.4%
Taylor expanded in z around inf 52.8%
Final simplification76.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.9e+117)
(- t (* t (/ x y)))
(if (<= y -3.05e-30)
(/ (* y t) (- y z))
(if (<= y -4.8e-149)
(/ (* x t) (- z y))
(if (<= y 1.05e-88)
(* (- x y) (/ t z))
(if (<= y 3.3e-48) (* t (/ x (- z y))) (- t (/ t (/ y x)))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.9e+117) {
tmp = t - (t * (x / y));
} else if (y <= -3.05e-30) {
tmp = (y * t) / (y - z);
} else if (y <= -4.8e-149) {
tmp = (x * t) / (z - y);
} else if (y <= 1.05e-88) {
tmp = (x - y) * (t / z);
} else if (y <= 3.3e-48) {
tmp = t * (x / (z - y));
} else {
tmp = t - (t / (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 (y <= (-1.9d+117)) then
tmp = t - (t * (x / y))
else if (y <= (-3.05d-30)) then
tmp = (y * t) / (y - z)
else if (y <= (-4.8d-149)) then
tmp = (x * t) / (z - y)
else if (y <= 1.05d-88) then
tmp = (x - y) * (t / z)
else if (y <= 3.3d-48) then
tmp = t * (x / (z - y))
else
tmp = t - (t / (y / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.9e+117) {
tmp = t - (t * (x / y));
} else if (y <= -3.05e-30) {
tmp = (y * t) / (y - z);
} else if (y <= -4.8e-149) {
tmp = (x * t) / (z - y);
} else if (y <= 1.05e-88) {
tmp = (x - y) * (t / z);
} else if (y <= 3.3e-48) {
tmp = t * (x / (z - y));
} else {
tmp = t - (t / (y / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.9e+117: tmp = t - (t * (x / y)) elif y <= -3.05e-30: tmp = (y * t) / (y - z) elif y <= -4.8e-149: tmp = (x * t) / (z - y) elif y <= 1.05e-88: tmp = (x - y) * (t / z) elif y <= 3.3e-48: tmp = t * (x / (z - y)) else: tmp = t - (t / (y / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.9e+117) tmp = Float64(t - Float64(t * Float64(x / y))); elseif (y <= -3.05e-30) tmp = Float64(Float64(y * t) / Float64(y - z)); elseif (y <= -4.8e-149) tmp = Float64(Float64(x * t) / Float64(z - y)); elseif (y <= 1.05e-88) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (y <= 3.3e-48) tmp = Float64(t * Float64(x / Float64(z - y))); else tmp = Float64(t - Float64(t / Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.9e+117) tmp = t - (t * (x / y)); elseif (y <= -3.05e-30) tmp = (y * t) / (y - z); elseif (y <= -4.8e-149) tmp = (x * t) / (z - y); elseif (y <= 1.05e-88) tmp = (x - y) * (t / z); elseif (y <= 3.3e-48) tmp = t * (x / (z - y)); else tmp = t - (t / (y / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.9e+117], N[(t - N[(t * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.05e-30], N[(N[(y * t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.8e-149], N[(N[(x * t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e-88], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.3e-48], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t - N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+117}:\\
\;\;\;\;t - t \cdot \frac{x}{y}\\
\mathbf{elif}\;y \leq -3.05 \cdot 10^{-30}:\\
\;\;\;\;\frac{y \cdot t}{y - z}\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{-149}:\\
\;\;\;\;\frac{x \cdot t}{z - y}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-88}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-48}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t - \frac{t}{\frac{y}{x}}\\
\end{array}
\end{array}
if y < -1.9000000000000001e117Initial program 100.0%
Taylor expanded in z around 0 82.4%
associate-*r/82.4%
neg-mul-182.4%
Simplified82.4%
Taylor expanded in x around 0 68.0%
mul-1-neg68.0%
unsub-neg68.0%
associate-/l*82.4%
Simplified82.4%
if -1.9000000000000001e117 < y < -3.0499999999999999e-30Initial program 98.9%
associate-*l/85.4%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in x around 0 71.0%
mul-1-neg71.0%
Simplified71.0%
if -3.0499999999999999e-30 < y < -4.8000000000000002e-149Initial program 96.3%
associate-*l/95.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 83.5%
if -4.8000000000000002e-149 < y < 1.05e-88Initial program 92.2%
associate-*l/90.1%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in z around inf 88.0%
if 1.05e-88 < y < 3.3e-48Initial program 100.0%
Taylor expanded in x around inf 100.0%
if 3.3e-48 < y Initial program 99.7%
Taylor expanded in z around 0 78.4%
associate-*r/78.4%
neg-mul-178.4%
Simplified78.4%
Taylor expanded in x around 0 75.2%
mul-1-neg75.2%
unsub-neg75.2%
associate-/l*78.4%
Simplified78.4%
clear-num78.4%
un-div-inv78.4%
Applied egg-rr78.4%
Final simplification82.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- t (* t (/ x y)))))
(if (<= y -1.85e+83)
t_1
(if (<= y -5.4e+65)
(* t (/ (- x y) z))
(if (or (<= y -5.5e-30) (not (<= y 3.3e-48)))
t_1
(* t (/ x (- z y))))))))
double code(double x, double y, double z, double t) {
double t_1 = t - (t * (x / y));
double tmp;
if (y <= -1.85e+83) {
tmp = t_1;
} else if (y <= -5.4e+65) {
tmp = t * ((x - y) / z);
} else if ((y <= -5.5e-30) || !(y <= 3.3e-48)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = t - (t * (x / y))
if (y <= (-1.85d+83)) then
tmp = t_1
else if (y <= (-5.4d+65)) then
tmp = t * ((x - y) / z)
else if ((y <= (-5.5d-30)) .or. (.not. (y <= 3.3d-48))) then
tmp = t_1
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 t_1 = t - (t * (x / y));
double tmp;
if (y <= -1.85e+83) {
tmp = t_1;
} else if (y <= -5.4e+65) {
tmp = t * ((x - y) / z);
} else if ((y <= -5.5e-30) || !(y <= 3.3e-48)) {
tmp = t_1;
} else {
tmp = t * (x / (z - y));
}
return tmp;
}
def code(x, y, z, t): t_1 = t - (t * (x / y)) tmp = 0 if y <= -1.85e+83: tmp = t_1 elif y <= -5.4e+65: tmp = t * ((x - y) / z) elif (y <= -5.5e-30) or not (y <= 3.3e-48): tmp = t_1 else: tmp = t * (x / (z - y)) return tmp
function code(x, y, z, t) t_1 = Float64(t - Float64(t * Float64(x / y))) tmp = 0.0 if (y <= -1.85e+83) tmp = t_1; elseif (y <= -5.4e+65) tmp = Float64(t * Float64(Float64(x - y) / z)); elseif ((y <= -5.5e-30) || !(y <= 3.3e-48)) tmp = t_1; else tmp = Float64(t * Float64(x / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t - (t * (x / y)); tmp = 0.0; if (y <= -1.85e+83) tmp = t_1; elseif (y <= -5.4e+65) tmp = t * ((x - y) / z); elseif ((y <= -5.5e-30) || ~((y <= 3.3e-48))) tmp = t_1; else tmp = t * (x / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t - N[(t * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.85e+83], t$95$1, If[LessEqual[y, -5.4e+65], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -5.5e-30], N[Not[LessEqual[y, 3.3e-48]], $MachinePrecision]], t$95$1, N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - t \cdot \frac{x}{y}\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5.4 \cdot 10^{+65}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{-30} \lor \neg \left(y \leq 3.3 \cdot 10^{-48}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\end{array}
\end{array}
if y < -1.8500000000000001e83 or -5.40000000000000038e65 < y < -5.49999999999999976e-30 or 3.3e-48 < y Initial program 99.7%
Taylor expanded in z around 0 76.9%
associate-*r/76.9%
neg-mul-176.9%
Simplified76.9%
Taylor expanded in x around 0 69.8%
mul-1-neg69.8%
unsub-neg69.8%
associate-/l*76.9%
Simplified76.9%
if -1.8500000000000001e83 < y < -5.40000000000000038e65Initial program 100.0%
Taylor expanded in z around inf 99.0%
if -5.49999999999999976e-30 < y < 3.3e-48Initial program 93.6%
Taylor expanded in x around inf 83.8%
Final simplification80.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- t (* t (/ x y)))))
(if (<= y -1.95e+85)
t_1
(if (<= y -9.2e+64)
(* t (/ (- x y) z))
(if (<= y -7.5e-30)
t_1
(if (<= y 3.3e-48) (* t (/ x (- z y))) (- t (/ t (/ y x)))))))))
double code(double x, double y, double z, double t) {
double t_1 = t - (t * (x / y));
double tmp;
if (y <= -1.95e+85) {
tmp = t_1;
} else if (y <= -9.2e+64) {
tmp = t * ((x - y) / z);
} else if (y <= -7.5e-30) {
tmp = t_1;
} else if (y <= 3.3e-48) {
tmp = t * (x / (z - y));
} else {
tmp = t - (t / (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) :: t_1
real(8) :: tmp
t_1 = t - (t * (x / y))
if (y <= (-1.95d+85)) then
tmp = t_1
else if (y <= (-9.2d+64)) then
tmp = t * ((x - y) / z)
else if (y <= (-7.5d-30)) then
tmp = t_1
else if (y <= 3.3d-48) then
tmp = t * (x / (z - y))
else
tmp = t - (t / (y / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t - (t * (x / y));
double tmp;
if (y <= -1.95e+85) {
tmp = t_1;
} else if (y <= -9.2e+64) {
tmp = t * ((x - y) / z);
} else if (y <= -7.5e-30) {
tmp = t_1;
} else if (y <= 3.3e-48) {
tmp = t * (x / (z - y));
} else {
tmp = t - (t / (y / x));
}
return tmp;
}
def code(x, y, z, t): t_1 = t - (t * (x / y)) tmp = 0 if y <= -1.95e+85: tmp = t_1 elif y <= -9.2e+64: tmp = t * ((x - y) / z) elif y <= -7.5e-30: tmp = t_1 elif y <= 3.3e-48: tmp = t * (x / (z - y)) else: tmp = t - (t / (y / x)) return tmp
function code(x, y, z, t) t_1 = Float64(t - Float64(t * Float64(x / y))) tmp = 0.0 if (y <= -1.95e+85) tmp = t_1; elseif (y <= -9.2e+64) tmp = Float64(t * Float64(Float64(x - y) / z)); elseif (y <= -7.5e-30) tmp = t_1; elseif (y <= 3.3e-48) tmp = Float64(t * Float64(x / Float64(z - y))); else tmp = Float64(t - Float64(t / Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t - (t * (x / y)); tmp = 0.0; if (y <= -1.95e+85) tmp = t_1; elseif (y <= -9.2e+64) tmp = t * ((x - y) / z); elseif (y <= -7.5e-30) tmp = t_1; elseif (y <= 3.3e-48) tmp = t * (x / (z - y)); else tmp = t - (t / (y / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t - N[(t * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.95e+85], t$95$1, If[LessEqual[y, -9.2e+64], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.5e-30], t$95$1, If[LessEqual[y, 3.3e-48], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t - N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - t \cdot \frac{x}{y}\\
\mathbf{if}\;y \leq -1.95 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -9.2 \cdot 10^{+64}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\mathbf{elif}\;y \leq -7.5 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-48}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t - \frac{t}{\frac{y}{x}}\\
\end{array}
\end{array}
if y < -1.95000000000000017e85 or -9.2e64 < y < -7.5000000000000006e-30Initial program 99.6%
Taylor expanded in z around 0 75.3%
associate-*r/75.3%
neg-mul-175.3%
Simplified75.3%
Taylor expanded in x around 0 64.0%
mul-1-neg64.0%
unsub-neg64.0%
associate-/l*75.3%
Simplified75.3%
if -1.95000000000000017e85 < y < -9.2e64Initial program 100.0%
Taylor expanded in z around inf 99.0%
if -7.5000000000000006e-30 < y < 3.3e-48Initial program 93.6%
Taylor expanded in x around inf 83.8%
if 3.3e-48 < y Initial program 99.7%
Taylor expanded in z around 0 78.4%
associate-*r/78.4%
neg-mul-178.4%
Simplified78.4%
Taylor expanded in x around 0 75.2%
mul-1-neg75.2%
unsub-neg75.2%
associate-/l*78.4%
Simplified78.4%
clear-num78.4%
un-div-inv78.4%
Applied egg-rr78.4%
Final simplification80.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ y (- y z)))))
(if (<= y -2.8e-31)
t_1
(if (<= y -1e-149)
(/ (* x t) (- z y))
(if (<= y 1.86e-88)
(* (- x y) (/ t z))
(if (<= y 1.85e-48) (* 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-31) {
tmp = t_1;
} else if (y <= -1e-149) {
tmp = (x * t) / (z - y);
} else if (y <= 1.86e-88) {
tmp = (x - y) * (t / z);
} else if (y <= 1.85e-48) {
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-31)) then
tmp = t_1
else if (y <= (-1d-149)) then
tmp = (x * t) / (z - y)
else if (y <= 1.86d-88) then
tmp = (x - y) * (t / z)
else if (y <= 1.85d-48) 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-31) {
tmp = t_1;
} else if (y <= -1e-149) {
tmp = (x * t) / (z - y);
} else if (y <= 1.86e-88) {
tmp = (x - y) * (t / z);
} else if (y <= 1.85e-48) {
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-31: tmp = t_1 elif y <= -1e-149: tmp = (x * t) / (z - y) elif y <= 1.86e-88: tmp = (x - y) * (t / z) elif y <= 1.85e-48: 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-31) tmp = t_1; elseif (y <= -1e-149) tmp = Float64(Float64(x * t) / Float64(z - y)); elseif (y <= 1.86e-88) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (y <= 1.85e-48) 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-31) tmp = t_1; elseif (y <= -1e-149) tmp = (x * t) / (z - y); elseif (y <= 1.86e-88) tmp = (x - y) * (t / z); elseif (y <= 1.85e-48) 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-31], t$95$1, If[LessEqual[y, -1e-149], N[(N[(x * t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.86e-88], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e-48], 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^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-149}:\\
\;\;\;\;\frac{x \cdot t}{z - y}\\
\mathbf{elif}\;y \leq 1.86 \cdot 10^{-88}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{-48}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.7999999999999999e-31 or 1.8499999999999999e-48 < y Initial program 99.7%
Taylor expanded in x around 0 80.2%
neg-mul-180.2%
distribute-neg-frac80.2%
Simplified80.2%
if -2.7999999999999999e-31 < y < -9.99999999999999979e-150Initial program 96.3%
associate-*l/95.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 83.5%
if -9.99999999999999979e-150 < y < 1.85999999999999991e-88Initial program 92.2%
associate-*l/90.1%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in z around inf 88.0%
if 1.85999999999999991e-88 < y < 1.8499999999999999e-48Initial program 100.0%
Taylor expanded in x around inf 100.0%
Final simplification83.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -9e+148)
t
(if (<= y -4.2e-15)
(* (/ y z) (- t))
(if (<= y -7e-30) t (if (<= y 3.3e-48) (* t (/ x z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e+148) {
tmp = t;
} else if (y <= -4.2e-15) {
tmp = (y / z) * -t;
} else if (y <= -7e-30) {
tmp = t;
} else if (y <= 3.3e-48) {
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 <= (-9d+148)) then
tmp = t
else if (y <= (-4.2d-15)) then
tmp = (y / z) * -t
else if (y <= (-7d-30)) then
tmp = t
else if (y <= 3.3d-48) 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 <= -9e+148) {
tmp = t;
} else if (y <= -4.2e-15) {
tmp = (y / z) * -t;
} else if (y <= -7e-30) {
tmp = t;
} else if (y <= 3.3e-48) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9e+148: tmp = t elif y <= -4.2e-15: tmp = (y / z) * -t elif y <= -7e-30: tmp = t elif y <= 3.3e-48: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9e+148) tmp = t; elseif (y <= -4.2e-15) tmp = Float64(Float64(y / z) * Float64(-t)); elseif (y <= -7e-30) tmp = t; elseif (y <= 3.3e-48) 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 <= -9e+148) tmp = t; elseif (y <= -4.2e-15) tmp = (y / z) * -t; elseif (y <= -7e-30) tmp = t; elseif (y <= 3.3e-48) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9e+148], t, If[LessEqual[y, -4.2e-15], N[(N[(y / z), $MachinePrecision] * (-t)), $MachinePrecision], If[LessEqual[y, -7e-30], t, If[LessEqual[y, 3.3e-48], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+148}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{y}{z} \cdot \left(-t\right)\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-30}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-48}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -8.99999999999999987e148 or -4.19999999999999962e-15 < y < -7.0000000000000006e-30 or 3.3e-48 < y Initial program 99.6%
associate-*l/67.6%
associate-/l*84.4%
Simplified84.4%
Taylor expanded in y around inf 72.0%
if -8.99999999999999987e148 < y < -4.19999999999999962e-15Initial program 100.0%
associate-*l/82.8%
associate-/l*89.5%
Simplified89.5%
Taylor expanded in z around inf 50.7%
Taylor expanded in x around 0 39.4%
mul-1-neg39.4%
associate-/l*42.2%
Simplified42.2%
if -7.0000000000000006e-30 < y < 3.3e-48Initial program 93.6%
Taylor expanded in y around 0 74.6%
Final simplification69.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.75e+148)
t
(if (<= y -3.8e-27)
(* t (/ (- x y) z))
(if (<= y 7e+72) (* t (/ x (- z y))) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.75e+148) {
tmp = t;
} else if (y <= -3.8e-27) {
tmp = t * ((x - y) / z);
} else if (y <= 7e+72) {
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+148)) then
tmp = t
else if (y <= (-3.8d-27)) then
tmp = t * ((x - y) / z)
else if (y <= 7d+72) 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+148) {
tmp = t;
} else if (y <= -3.8e-27) {
tmp = t * ((x - y) / z);
} else if (y <= 7e+72) {
tmp = t * (x / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.75e+148: tmp = t elif y <= -3.8e-27: tmp = t * ((x - y) / z) elif y <= 7e+72: tmp = t * (x / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.75e+148) tmp = t; elseif (y <= -3.8e-27) tmp = Float64(t * Float64(Float64(x - y) / z)); elseif (y <= 7e+72) 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+148) tmp = t; elseif (y <= -3.8e-27) tmp = t * ((x - y) / z); elseif (y <= 7e+72) tmp = t * (x / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.75e+148], t, If[LessEqual[y, -3.8e-27], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+72], 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^{+148}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-27}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+72}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.7499999999999999e148 or 7.0000000000000002e72 < y Initial program 99.9%
associate-*l/58.6%
associate-/l*80.8%
Simplified80.8%
Taylor expanded in y around inf 81.9%
if -1.7499999999999999e148 < y < -3.8e-27Initial program 99.2%
Taylor expanded in z around inf 55.1%
if -3.8e-27 < y < 7.0000000000000002e72Initial program 94.7%
Taylor expanded in x around inf 76.8%
Final simplification75.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.6e+149) (not (<= y 6.4e+205))) (* t (/ y (- y z))) (* (- y x) (/ t (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.6e+149) || !(y <= 6.4e+205)) {
tmp = t * (y / (y - z));
} else {
tmp = (y - x) * (t / (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 <= (-4.6d+149)) .or. (.not. (y <= 6.4d+205))) then
tmp = t * (y / (y - z))
else
tmp = (y - x) * (t / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.6e+149) || !(y <= 6.4e+205)) {
tmp = t * (y / (y - z));
} else {
tmp = (y - x) * (t / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.6e+149) or not (y <= 6.4e+205): tmp = t * (y / (y - z)) else: tmp = (y - x) * (t / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.6e+149) || !(y <= 6.4e+205)) tmp = Float64(t * Float64(y / Float64(y - z))); else tmp = Float64(Float64(y - x) * Float64(t / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4.6e+149) || ~((y <= 6.4e+205))) tmp = t * (y / (y - z)); else tmp = (y - x) * (t / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.6e+149], N[Not[LessEqual[y, 6.4e+205]], $MachinePrecision]], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+149} \lor \neg \left(y \leq 6.4 \cdot 10^{+205}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\left(y - x\right) \cdot \frac{t}{y - z}\\
\end{array}
\end{array}
if y < -4.5999999999999997e149 or 6.39999999999999993e205 < y Initial program 100.0%
Taylor expanded in x around 0 96.0%
neg-mul-196.0%
distribute-neg-frac96.0%
Simplified96.0%
if -4.5999999999999997e149 < y < 6.39999999999999993e205Initial program 96.3%
associate-*l/86.8%
associate-/l*94.0%
Simplified94.0%
Final simplification94.4%
(FPCore (x y z t) :precision binary64 (if (<= y -1.65e+148) t (if (<= y 7.6e+72) (* (- x y) (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.65e+148) {
tmp = t;
} else if (y <= 7.6e+72) {
tmp = (x - 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 <= (-1.65d+148)) then
tmp = t
else if (y <= 7.6d+72) then
tmp = (x - 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 <= -1.65e+148) {
tmp = t;
} else if (y <= 7.6e+72) {
tmp = (x - y) * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.65e+148: tmp = t elif y <= 7.6e+72: tmp = (x - y) * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.65e+148) tmp = t; elseif (y <= 7.6e+72) tmp = Float64(Float64(x - y) * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.65e+148) tmp = t; elseif (y <= 7.6e+72) tmp = (x - y) * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.65e+148], t, If[LessEqual[y, 7.6e+72], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{+148}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{+72}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.65000000000000005e148 or 7.60000000000000012e72 < y Initial program 99.9%
associate-*l/58.6%
associate-/l*80.8%
Simplified80.8%
Taylor expanded in y around inf 81.9%
if -1.65000000000000005e148 < y < 7.60000000000000012e72Initial program 95.6%
associate-*l/90.8%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in z around inf 68.4%
Final simplification72.9%
(FPCore (x y z t) :precision binary64 (if (<= y -4.2e-30) t (if (<= y 2.65e-48) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.2e-30) {
tmp = t;
} else if (y <= 2.65e-48) {
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 <= (-4.2d-30)) then
tmp = t
else if (y <= 2.65d-48) 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 <= -4.2e-30) {
tmp = t;
} else if (y <= 2.65e-48) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.2e-30: tmp = t elif y <= 2.65e-48: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.2e-30) tmp = t; elseif (y <= 2.65e-48) 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 <= -4.2e-30) tmp = t; elseif (y <= 2.65e-48) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.2e-30], t, If[LessEqual[y, 2.65e-48], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{-30}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.65 \cdot 10^{-48}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -4.2000000000000004e-30 or 2.65e-48 < y Initial program 99.7%
associate-*l/71.1%
associate-/l*85.6%
Simplified85.6%
Taylor expanded in y around inf 61.0%
if -4.2000000000000004e-30 < y < 2.65e-48Initial program 93.6%
associate-*l/91.9%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in y around 0 72.3%
*-commutative72.3%
associate-/l*74.3%
Simplified74.3%
Final simplification66.7%
(FPCore (x y z t) :precision binary64 (if (<= y -5.2e-30) t (if (<= y 3.3e-48) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.2e-30) {
tmp = t;
} else if (y <= 3.3e-48) {
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 <= (-5.2d-30)) then
tmp = t
else if (y <= 3.3d-48) 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 <= -5.2e-30) {
tmp = t;
} else if (y <= 3.3e-48) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.2e-30: tmp = t elif y <= 3.3e-48: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.2e-30) tmp = t; elseif (y <= 3.3e-48) 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 <= -5.2e-30) tmp = t; elseif (y <= 3.3e-48) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.2e-30], t, If[LessEqual[y, 3.3e-48], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{-30}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-48}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -5.19999999999999973e-30 or 3.3e-48 < y Initial program 99.7%
associate-*l/71.1%
associate-/l*85.6%
Simplified85.6%
Taylor expanded in y around inf 61.0%
if -5.19999999999999973e-30 < y < 3.3e-48Initial program 93.6%
Taylor expanded in y around 0 74.6%
Final simplification66.8%
(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.1%
associate-*l/80.0%
associate-/l*89.9%
Simplified89.9%
Taylor expanded in y around inf 38.2%
Final simplification38.2%
(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 2024045
(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))