
(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 11 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.3%
Final simplification96.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ t (- 1.0 (/ z y)))))
(if (<= y -1e+113)
t_1
(if (<= y -1.55e+87)
(* t (/ (- x) y))
(if (or (<= y -8.8e-60) (not (<= y 4.1e+24)))
t_1
(* x (/ t (- z y))))))))
double code(double x, double y, double z, double t) {
double t_1 = t / (1.0 - (z / y));
double tmp;
if (y <= -1e+113) {
tmp = t_1;
} else if (y <= -1.55e+87) {
tmp = t * (-x / y);
} else if ((y <= -8.8e-60) || !(y <= 4.1e+24)) {
tmp = t_1;
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = t / (1.0d0 - (z / y))
if (y <= (-1d+113)) then
tmp = t_1
else if (y <= (-1.55d+87)) then
tmp = t * (-x / y)
else if ((y <= (-8.8d-60)) .or. (.not. (y <= 4.1d+24))) then
tmp = t_1
else
tmp = x * (t / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t / (1.0 - (z / y));
double tmp;
if (y <= -1e+113) {
tmp = t_1;
} else if (y <= -1.55e+87) {
tmp = t * (-x / y);
} else if ((y <= -8.8e-60) || !(y <= 4.1e+24)) {
tmp = t_1;
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): t_1 = t / (1.0 - (z / y)) tmp = 0 if y <= -1e+113: tmp = t_1 elif y <= -1.55e+87: tmp = t * (-x / y) elif (y <= -8.8e-60) or not (y <= 4.1e+24): tmp = t_1 else: tmp = x * (t / (z - y)) return tmp
function code(x, y, z, t) t_1 = Float64(t / Float64(1.0 - Float64(z / y))) tmp = 0.0 if (y <= -1e+113) tmp = t_1; elseif (y <= -1.55e+87) tmp = Float64(t * Float64(Float64(-x) / y)); elseif ((y <= -8.8e-60) || !(y <= 4.1e+24)) tmp = t_1; else tmp = Float64(x * Float64(t / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t / (1.0 - (z / y)); tmp = 0.0; if (y <= -1e+113) tmp = t_1; elseif (y <= -1.55e+87) tmp = t * (-x / y); elseif ((y <= -8.8e-60) || ~((y <= 4.1e+24))) tmp = t_1; else tmp = x * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e+113], t$95$1, If[LessEqual[y, -1.55e+87], N[(t * N[((-x) / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -8.8e-60], N[Not[LessEqual[y, 4.1e+24]], $MachinePrecision]], t$95$1, N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{1 - \frac{z}{y}}\\
\mathbf{if}\;y \leq -1 \cdot 10^{+113}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.55 \cdot 10^{+87}:\\
\;\;\;\;t \cdot \frac{-x}{y}\\
\mathbf{elif}\;y \leq -8.8 \cdot 10^{-60} \lor \neg \left(y \leq 4.1 \cdot 10^{+24}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -1e113 or -1.55e87 < y < -8.7999999999999995e-60 or 4.1000000000000001e24 < y Initial program 99.8%
associate-*l/72.7%
associate-*r/77.3%
Simplified77.3%
associate-*r/72.7%
associate-*l/99.8%
*-commutative99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 79.2%
associate-*r/79.2%
neg-mul-179.2%
neg-sub079.2%
associate--r-79.2%
neg-sub079.2%
Simplified79.2%
Taylor expanded in z around 0 79.2%
mul-1-neg79.2%
unsub-neg79.2%
Simplified79.2%
if -1e113 < y < -1.55e87Initial program 100.0%
Taylor expanded in x around inf 97.2%
Taylor expanded in z around 0 97.2%
associate-*r/97.2%
neg-mul-197.2%
Simplified97.2%
if -8.7999999999999995e-60 < y < 4.1000000000000001e24Initial program 92.9%
associate-*l/89.0%
associate-*r/96.1%
Simplified96.1%
Taylor expanded in x around inf 77.6%
associate-*l/84.0%
*-commutative84.0%
Simplified84.0%
Final simplification82.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -5.6e+169)
t
(if (<= y -1.6e+87)
(* t (/ (- x) y))
(if (<= y -3.5e-37) t (if (<= y 1.1e+97) (* x (/ t (- z y))) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.6e+169) {
tmp = t;
} else if (y <= -1.6e+87) {
tmp = t * (-x / y);
} else if (y <= -3.5e-37) {
tmp = t;
} else if (y <= 1.1e+97) {
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 <= (-5.6d+169)) then
tmp = t
else if (y <= (-1.6d+87)) then
tmp = t * (-x / y)
else if (y <= (-3.5d-37)) then
tmp = t
else if (y <= 1.1d+97) 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 <= -5.6e+169) {
tmp = t;
} else if (y <= -1.6e+87) {
tmp = t * (-x / y);
} else if (y <= -3.5e-37) {
tmp = t;
} else if (y <= 1.1e+97) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.6e+169: tmp = t elif y <= -1.6e+87: tmp = t * (-x / y) elif y <= -3.5e-37: tmp = t elif y <= 1.1e+97: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.6e+169) tmp = t; elseif (y <= -1.6e+87) tmp = Float64(t * Float64(Float64(-x) / y)); elseif (y <= -3.5e-37) tmp = t; elseif (y <= 1.1e+97) 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 <= -5.6e+169) tmp = t; elseif (y <= -1.6e+87) tmp = t * (-x / y); elseif (y <= -3.5e-37) tmp = t; elseif (y <= 1.1e+97) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.6e+169], t, If[LessEqual[y, -1.6e+87], N[(t * N[((-x) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.5e-37], t, If[LessEqual[y, 1.1e+97], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{+169}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -1.6 \cdot 10^{+87}:\\
\;\;\;\;t \cdot \frac{-x}{y}\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-37}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+97}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -5.6000000000000003e169 or -1.6e87 < y < -3.5000000000000001e-37 or 1.1e97 < y Initial program 99.8%
associate-*l/68.9%
associate-*r/72.7%
Simplified72.7%
Taylor expanded in y around inf 68.8%
if -5.6000000000000003e169 < y < -1.6e87Initial program 100.0%
Taylor expanded in x around inf 69.5%
Taylor expanded in z around 0 69.7%
associate-*r/69.7%
neg-mul-169.7%
Simplified69.7%
if -3.5000000000000001e-37 < y < 1.1e97Initial program 93.8%
associate-*l/89.1%
associate-*r/96.6%
Simplified96.6%
Taylor expanded in x around inf 72.7%
associate-*l/79.0%
*-commutative79.0%
Simplified79.0%
Final simplification74.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.12e+192)
t
(if (<= y -9.7e+39)
(* t (/ x (- z y)))
(if (<= y -3.8e-37) t (if (<= y 5.5e+96) (* x (/ t (- z y))) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.12e+192) {
tmp = t;
} else if (y <= -9.7e+39) {
tmp = t * (x / (z - y));
} else if (y <= -3.8e-37) {
tmp = t;
} else if (y <= 5.5e+96) {
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+192)) then
tmp = t
else if (y <= (-9.7d+39)) then
tmp = t * (x / (z - y))
else if (y <= (-3.8d-37)) then
tmp = t
else if (y <= 5.5d+96) 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+192) {
tmp = t;
} else if (y <= -9.7e+39) {
tmp = t * (x / (z - y));
} else if (y <= -3.8e-37) {
tmp = t;
} else if (y <= 5.5e+96) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.12e+192: tmp = t elif y <= -9.7e+39: tmp = t * (x / (z - y)) elif y <= -3.8e-37: tmp = t elif y <= 5.5e+96: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.12e+192) tmp = t; elseif (y <= -9.7e+39) tmp = Float64(t * Float64(x / Float64(z - y))); elseif (y <= -3.8e-37) tmp = t; elseif (y <= 5.5e+96) 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+192) tmp = t; elseif (y <= -9.7e+39) tmp = t * (x / (z - y)); elseif (y <= -3.8e-37) tmp = t; elseif (y <= 5.5e+96) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.12e+192], t, If[LessEqual[y, -9.7e+39], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.8e-37], t, If[LessEqual[y, 5.5e+96], 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^{+192}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -9.7 \cdot 10^{+39}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-37}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+96}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.12e192 or -9.6999999999999995e39 < y < -3.8000000000000004e-37 or 5.5000000000000002e96 < y Initial program 99.8%
associate-*l/65.1%
associate-*r/67.3%
Simplified67.3%
Taylor expanded in y around inf 74.3%
if -1.12e192 < y < -9.6999999999999995e39Initial program 99.8%
Taylor expanded in x around inf 54.7%
if -3.8000000000000004e-37 < y < 5.5000000000000002e96Initial program 93.8%
associate-*l/89.1%
associate-*r/96.6%
Simplified96.6%
Taylor expanded in x around inf 72.7%
associate-*l/79.0%
*-commutative79.0%
Simplified79.0%
Final simplification75.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.12e+192)
t
(if (<= y -8e+60)
(* x (/ (- t) y))
(if (<= y -3.8e-37) t (if (<= y 4.1e+20) (* x (/ t z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.12e+192) {
tmp = t;
} else if (y <= -8e+60) {
tmp = x * (-t / y);
} else if (y <= -3.8e-37) {
tmp = t;
} else if (y <= 4.1e+20) {
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+192)) then
tmp = t
else if (y <= (-8d+60)) then
tmp = x * (-t / y)
else if (y <= (-3.8d-37)) then
tmp = t
else if (y <= 4.1d+20) 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+192) {
tmp = t;
} else if (y <= -8e+60) {
tmp = x * (-t / y);
} else if (y <= -3.8e-37) {
tmp = t;
} else if (y <= 4.1e+20) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.12e+192: tmp = t elif y <= -8e+60: tmp = x * (-t / y) elif y <= -3.8e-37: tmp = t elif y <= 4.1e+20: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.12e+192) tmp = t; elseif (y <= -8e+60) tmp = Float64(x * Float64(Float64(-t) / y)); elseif (y <= -3.8e-37) tmp = t; elseif (y <= 4.1e+20) 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.12e+192) tmp = t; elseif (y <= -8e+60) tmp = x * (-t / y); elseif (y <= -3.8e-37) tmp = t; elseif (y <= 4.1e+20) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.12e+192], t, If[LessEqual[y, -8e+60], N[(x * N[((-t) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.8e-37], t, If[LessEqual[y, 4.1e+20], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{+192}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -8 \cdot 10^{+60}:\\
\;\;\;\;x \cdot \frac{-t}{y}\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-37}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{+20}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.12e192 or -7.9999999999999996e60 < y < -3.8000000000000004e-37 or 4.1e20 < y Initial program 99.8%
associate-*l/69.2%
associate-*r/73.8%
Simplified73.8%
Taylor expanded in y around inf 66.1%
if -1.12e192 < y < -7.9999999999999996e60Initial program 99.9%
associate-*l/86.4%
associate-*r/95.1%
Simplified95.1%
Taylor expanded in x around inf 48.8%
associate-*l/53.1%
*-commutative53.1%
Simplified53.1%
Taylor expanded in z around 0 53.2%
associate-*r/53.2%
neg-mul-153.2%
Simplified53.2%
if -3.8000000000000004e-37 < y < 4.1e20Initial program 93.1%
associate-*l/89.3%
associate-*r/96.2%
Simplified96.2%
Taylor expanded in x around inf 76.1%
associate-*l/82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in z around inf 70.0%
Final simplification67.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -5.6e+169)
t
(if (<= y -1.6e+87)
(* t (/ (- x) y))
(if (<= y -3.8e-37) t (if (<= y 7.5e+19) (* x (/ t z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.6e+169) {
tmp = t;
} else if (y <= -1.6e+87) {
tmp = t * (-x / y);
} else if (y <= -3.8e-37) {
tmp = t;
} else if (y <= 7.5e+19) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-5.6d+169)) then
tmp = t
else if (y <= (-1.6d+87)) then
tmp = t * (-x / y)
else if (y <= (-3.8d-37)) then
tmp = t
else if (y <= 7.5d+19) then
tmp = x * (t / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.6e+169) {
tmp = t;
} else if (y <= -1.6e+87) {
tmp = t * (-x / y);
} else if (y <= -3.8e-37) {
tmp = t;
} else if (y <= 7.5e+19) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.6e+169: tmp = t elif y <= -1.6e+87: tmp = t * (-x / y) elif y <= -3.8e-37: tmp = t elif y <= 7.5e+19: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.6e+169) tmp = t; elseif (y <= -1.6e+87) tmp = Float64(t * Float64(Float64(-x) / y)); elseif (y <= -3.8e-37) tmp = t; elseif (y <= 7.5e+19) tmp = Float64(x * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5.6e+169) tmp = t; elseif (y <= -1.6e+87) tmp = t * (-x / y); elseif (y <= -3.8e-37) tmp = t; elseif (y <= 7.5e+19) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.6e+169], t, If[LessEqual[y, -1.6e+87], N[(t * N[((-x) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.8e-37], t, If[LessEqual[y, 7.5e+19], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{+169}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -1.6 \cdot 10^{+87}:\\
\;\;\;\;t \cdot \frac{-x}{y}\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-37}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+19}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -5.6000000000000003e169 or -1.6e87 < y < -3.8000000000000004e-37 or 7.5e19 < y Initial program 99.8%
associate-*l/71.4%
associate-*r/76.3%
Simplified76.3%
Taylor expanded in y around inf 63.7%
if -5.6000000000000003e169 < y < -1.6e87Initial program 100.0%
Taylor expanded in x around inf 69.5%
Taylor expanded in z around 0 69.7%
associate-*r/69.7%
neg-mul-169.7%
Simplified69.7%
if -3.8000000000000004e-37 < y < 7.5e19Initial program 93.1%
associate-*l/89.3%
associate-*r/96.2%
Simplified96.2%
Taylor expanded in x around inf 76.1%
associate-*l/82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in z around inf 70.0%
Final simplification67.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ t (- 1.0 (/ z y)))))
(if (<= y -1.6e+218)
t_1
(if (<= y -3.45e-37)
(* (/ t y) (- y x))
(if (<= y 3.6e+24) (* x (/ t (- z y))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = t / (1.0 - (z / y));
double tmp;
if (y <= -1.6e+218) {
tmp = t_1;
} else if (y <= -3.45e-37) {
tmp = (t / y) * (y - x);
} else if (y <= 3.6e+24) {
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 / (1.0d0 - (z / y))
if (y <= (-1.6d+218)) then
tmp = t_1
else if (y <= (-3.45d-37)) then
tmp = (t / y) * (y - x)
else if (y <= 3.6d+24) 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 / (1.0 - (z / y));
double tmp;
if (y <= -1.6e+218) {
tmp = t_1;
} else if (y <= -3.45e-37) {
tmp = (t / y) * (y - x);
} else if (y <= 3.6e+24) {
tmp = x * (t / (z - y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t / (1.0 - (z / y)) tmp = 0 if y <= -1.6e+218: tmp = t_1 elif y <= -3.45e-37: tmp = (t / y) * (y - x) elif y <= 3.6e+24: tmp = x * (t / (z - y)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t / Float64(1.0 - Float64(z / y))) tmp = 0.0 if (y <= -1.6e+218) tmp = t_1; elseif (y <= -3.45e-37) tmp = Float64(Float64(t / y) * Float64(y - x)); elseif (y <= 3.6e+24) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t / (1.0 - (z / y)); tmp = 0.0; if (y <= -1.6e+218) tmp = t_1; elseif (y <= -3.45e-37) tmp = (t / y) * (y - x); elseif (y <= 3.6e+24) 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[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.6e+218], t$95$1, If[LessEqual[y, -3.45e-37], N[(N[(t / y), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.6e+24], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{1 - \frac{z}{y}}\\
\mathbf{if}\;y \leq -1.6 \cdot 10^{+218}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.45 \cdot 10^{-37}:\\
\;\;\;\;\frac{t}{y} \cdot \left(y - x\right)\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+24}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.59999999999999994e218 or 3.59999999999999983e24 < y Initial program 99.9%
associate-*l/66.8%
associate-*r/69.6%
Simplified69.6%
associate-*r/66.8%
associate-*l/99.9%
*-commutative99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 83.0%
associate-*r/83.0%
neg-mul-183.0%
neg-sub083.0%
associate--r-83.0%
neg-sub083.0%
Simplified83.0%
Taylor expanded in z around 0 83.0%
mul-1-neg83.0%
unsub-neg83.0%
Simplified83.0%
if -1.59999999999999994e218 < y < -3.4499999999999999e-37Initial program 99.8%
associate-*l/82.3%
associate-*r/92.5%
Simplified92.5%
Taylor expanded in z around 0 79.7%
associate-*r/39.1%
neg-mul-139.1%
Simplified79.7%
if -3.4499999999999999e-37 < y < 3.59999999999999983e24Initial program 93.1%
associate-*l/89.4%
associate-*r/96.3%
Simplified96.3%
Taylor expanded in x around inf 76.3%
associate-*l/82.5%
*-commutative82.5%
Simplified82.5%
Final simplification82.2%
(FPCore (x y z t) :precision binary64 (if (<= y -1.7e+218) (/ t (- 1.0 (/ z y))) (if (<= y 4.8e+212) (* (- x y) (/ t (- z y))) (/ (- t) (/ y (- x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e+218) {
tmp = t / (1.0 - (z / y));
} else if (y <= 4.8e+212) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = -t / (y / (x - 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 <= (-1.7d+218)) then
tmp = t / (1.0d0 - (z / y))
else if (y <= 4.8d+212) then
tmp = (x - y) * (t / (z - y))
else
tmp = -t / (y / (x - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e+218) {
tmp = t / (1.0 - (z / y));
} else if (y <= 4.8e+212) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = -t / (y / (x - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.7e+218: tmp = t / (1.0 - (z / y)) elif y <= 4.8e+212: tmp = (x - y) * (t / (z - y)) else: tmp = -t / (y / (x - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e+218) tmp = Float64(t / Float64(1.0 - Float64(z / y))); elseif (y <= 4.8e+212) tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); else tmp = Float64(Float64(-t) / Float64(y / Float64(x - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.7e+218) tmp = t / (1.0 - (z / y)); elseif (y <= 4.8e+212) tmp = (x - y) * (t / (z - y)); else tmp = -t / (y / (x - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.7e+218], N[(t / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e+212], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-t) / N[(y / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+218}:\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+212}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t}{\frac{y}{x - y}}\\
\end{array}
\end{array}
if y < -1.70000000000000004e218Initial program 99.9%
associate-*l/67.9%
associate-*r/52.8%
Simplified52.8%
associate-*r/67.9%
associate-*l/99.9%
*-commutative99.9%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 95.0%
associate-*r/95.0%
neg-mul-195.0%
neg-sub095.0%
associate--r-95.0%
neg-sub095.0%
Simplified95.0%
Taylor expanded in z around 0 95.0%
mul-1-neg95.0%
unsub-neg95.0%
Simplified95.0%
if -1.70000000000000004e218 < y < 4.8e212Initial program 95.6%
associate-*l/85.3%
associate-*r/93.4%
Simplified93.4%
if 4.8e212 < y Initial program 100.0%
associate-*l/52.5%
associate-*r/56.5%
Simplified56.5%
associate-*r/52.5%
associate-*l/100.0%
*-commutative100.0%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in z around 0 52.5%
mul-1-neg52.5%
associate-/l*100.0%
distribute-neg-frac100.0%
Simplified100.0%
Final simplification94.1%
(FPCore (x y z t) :precision binary64 (if (<= y -3.8e-37) (/ (- t) (/ y (- x y))) (if (<= y 4.5e+24) (* x (/ t (- z y))) (/ t (- 1.0 (/ z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.8e-37) {
tmp = -t / (y / (x - y));
} else if (y <= 4.5e+24) {
tmp = x * (t / (z - y));
} else {
tmp = t / (1.0 - (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-37)) then
tmp = -t / (y / (x - y))
else if (y <= 4.5d+24) then
tmp = x * (t / (z - y))
else
tmp = t / (1.0d0 - (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-37) {
tmp = -t / (y / (x - y));
} else if (y <= 4.5e+24) {
tmp = x * (t / (z - y));
} else {
tmp = t / (1.0 - (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.8e-37: tmp = -t / (y / (x - y)) elif y <= 4.5e+24: tmp = x * (t / (z - y)) else: tmp = t / (1.0 - (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.8e-37) tmp = Float64(Float64(-t) / Float64(y / Float64(x - y))); elseif (y <= 4.5e+24) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = Float64(t / Float64(1.0 - Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.8e-37) tmp = -t / (y / (x - y)); elseif (y <= 4.5e+24) tmp = x * (t / (z - y)); else tmp = t / (1.0 - (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.8e-37], N[((-t) / N[(y / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+24], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{-37}:\\
\;\;\;\;\frac{-t}{\frac{y}{x - y}}\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+24}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\
\end{array}
\end{array}
if y < -3.8000000000000004e-37Initial program 99.8%
associate-*l/77.8%
associate-*r/80.2%
Simplified80.2%
associate-*r/77.8%
associate-*l/99.8%
*-commutative99.8%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 64.5%
mul-1-neg64.5%
associate-/l*81.7%
distribute-neg-frac81.7%
Simplified81.7%
if -3.8000000000000004e-37 < y < 4.50000000000000019e24Initial program 93.1%
associate-*l/89.4%
associate-*r/96.3%
Simplified96.3%
Taylor expanded in x around inf 76.3%
associate-*l/82.5%
*-commutative82.5%
Simplified82.5%
if 4.50000000000000019e24 < y Initial program 99.8%
associate-*l/66.5%
associate-*r/74.5%
Simplified74.5%
associate-*r/66.5%
associate-*l/99.8%
*-commutative99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 79.5%
associate-*r/79.5%
neg-mul-179.5%
neg-sub079.5%
associate--r-79.5%
neg-sub079.5%
Simplified79.5%
Taylor expanded in z around 0 79.5%
mul-1-neg79.5%
unsub-neg79.5%
Simplified79.5%
Final simplification81.6%
(FPCore (x y z t) :precision binary64 (if (<= y -3.5e-37) t (if (<= y 4.3e+19) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e-37) {
tmp = t;
} else if (y <= 4.3e+19) {
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 <= (-3.5d-37)) then
tmp = t
else if (y <= 4.3d+19) 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 <= -3.5e-37) {
tmp = t;
} else if (y <= 4.3e+19) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.5e-37: tmp = t elif y <= 4.3e+19: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.5e-37) tmp = t; elseif (y <= 4.3e+19) 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 <= -3.5e-37) tmp = t; elseif (y <= 4.3e+19) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.5e-37], t, If[LessEqual[y, 4.3e+19], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-37}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4.3 \cdot 10^{+19}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.5000000000000001e-37 or 4.3e19 < y Initial program 99.8%
associate-*l/72.2%
associate-*r/77.5%
Simplified77.5%
Taylor expanded in y around inf 59.7%
if -3.5000000000000001e-37 < y < 4.3e19Initial program 93.1%
associate-*l/89.3%
associate-*r/96.2%
Simplified96.2%
Taylor expanded in x around inf 76.1%
associate-*l/82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in z around inf 70.0%
Final simplification65.1%
(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.3%
associate-*l/81.2%
associate-*r/87.4%
Simplified87.4%
Taylor expanded in y around inf 33.1%
Final simplification33.1%
(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 2023192
(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))