
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x - y) / (z - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
Initial program 95.5%
*-commutative95.5%
clear-num95.0%
un-div-inv95.8%
Applied egg-rr95.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- x y) (/ t (- z y)))))
(if (<= y -5.6e+94)
(* t (/ y (- y z)))
(if (<= y 1e-265)
t_1
(if (<= y 1.65e-151)
(/ (* t x) (- z y))
(if (<= y 5.2e+254) t_1 (/ t (- (- -1.0) (/ z y)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x - y) * (t / (z - y));
double tmp;
if (y <= -5.6e+94) {
tmp = t * (y / (y - z));
} else if (y <= 1e-265) {
tmp = t_1;
} else if (y <= 1.65e-151) {
tmp = (t * x) / (z - y);
} else if (y <= 5.2e+254) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x - y) * (t / (z - y))
if (y <= (-5.6d+94)) then
tmp = t * (y / (y - z))
else if (y <= 1d-265) then
tmp = t_1
else if (y <= 1.65d-151) then
tmp = (t * x) / (z - y)
else if (y <= 5.2d+254) then
tmp = t_1
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 t_1 = (x - y) * (t / (z - y));
double tmp;
if (y <= -5.6e+94) {
tmp = t * (y / (y - z));
} else if (y <= 1e-265) {
tmp = t_1;
} else if (y <= 1.65e-151) {
tmp = (t * x) / (z - y);
} else if (y <= 5.2e+254) {
tmp = t_1;
} else {
tmp = t / (-(-1.0) - (z / y));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - y) * (t / (z - y)) tmp = 0 if y <= -5.6e+94: tmp = t * (y / (y - z)) elif y <= 1e-265: tmp = t_1 elif y <= 1.65e-151: tmp = (t * x) / (z - y) elif y <= 5.2e+254: tmp = t_1 else: tmp = t / (-(-1.0) - (z / y)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - y) * Float64(t / Float64(z - y))) tmp = 0.0 if (y <= -5.6e+94) tmp = Float64(t * Float64(y / Float64(y - z))); elseif (y <= 1e-265) tmp = t_1; elseif (y <= 1.65e-151) tmp = Float64(Float64(t * x) / Float64(z - y)); elseif (y <= 5.2e+254) tmp = t_1; else tmp = Float64(t / Float64(Float64(-(-1.0)) - Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - y) * (t / (z - y)); tmp = 0.0; if (y <= -5.6e+94) tmp = t * (y / (y - z)); elseif (y <= 1e-265) tmp = t_1; elseif (y <= 1.65e-151) tmp = (t * x) / (z - y); elseif (y <= 5.2e+254) tmp = t_1; else tmp = t / (-(-1.0) - (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.6e+94], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e-265], t$95$1, If[LessEqual[y, 1.65e-151], N[(N[(t * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e+254], t$95$1, N[(t / N[((--1.0) - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{if}\;y \leq -5.6 \cdot 10^{+94}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{elif}\;y \leq 10^{-265}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-151}:\\
\;\;\;\;\frac{t \cdot x}{z - y}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+254}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\left(--1\right) - \frac{z}{y}}\\
\end{array}
\end{array}
if y < -5.59999999999999997e94Initial program 100.0%
Taylor expanded in x around 0 93.3%
neg-mul-193.3%
distribute-neg-frac93.3%
Simplified93.3%
if -5.59999999999999997e94 < y < 9.99999999999999985e-266 or 1.6499999999999999e-151 < y < 5.2000000000000002e254Initial program 93.5%
Taylor expanded in x around 0 90.9%
mul-1-neg90.9%
associate-/l*93.3%
distribute-rgt-neg-in93.3%
associate-/l*93.5%
distribute-lft-in93.5%
+-commutative93.5%
sub-neg93.5%
div-sub93.5%
associate-*r/91.6%
associate-*l/95.6%
Simplified95.6%
if 9.99999999999999985e-266 < y < 1.6499999999999999e-151Initial program 95.0%
Taylor expanded in x around inf 99.5%
if 5.2000000000000002e254 < y Initial program 99.8%
*-commutative99.8%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification95.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- (/ x (- y)) -1.0))))
(if (<= y -7e+111)
t_1
(if (<= y -3.05e+63)
(* t (/ (- x y) z))
(if (<= y 1.85e-265)
(* x (/ t (- z y)))
(if (<= y 6.4e+35) (/ (* t x) (- z y)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = t * ((x / -y) - -1.0);
double tmp;
if (y <= -7e+111) {
tmp = t_1;
} else if (y <= -3.05e+63) {
tmp = t * ((x - y) / z);
} else if (y <= 1.85e-265) {
tmp = x * (t / (z - y));
} else if (y <= 6.4e+35) {
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 * ((x / -y) - (-1.0d0))
if (y <= (-7d+111)) then
tmp = t_1
else if (y <= (-3.05d+63)) then
tmp = t * ((x - y) / z)
else if (y <= 1.85d-265) then
tmp = x * (t / (z - y))
else if (y <= 6.4d+35) 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 * ((x / -y) - -1.0);
double tmp;
if (y <= -7e+111) {
tmp = t_1;
} else if (y <= -3.05e+63) {
tmp = t * ((x - y) / z);
} else if (y <= 1.85e-265) {
tmp = x * (t / (z - y));
} else if (y <= 6.4e+35) {
tmp = (t * x) / (z - y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * ((x / -y) - -1.0) tmp = 0 if y <= -7e+111: tmp = t_1 elif y <= -3.05e+63: tmp = t * ((x - y) / z) elif y <= 1.85e-265: tmp = x * (t / (z - y)) elif y <= 6.4e+35: tmp = (t * x) / (z - y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(Float64(x / Float64(-y)) - -1.0)) tmp = 0.0 if (y <= -7e+111) tmp = t_1; elseif (y <= -3.05e+63) tmp = Float64(t * Float64(Float64(x - y) / z)); elseif (y <= 1.85e-265) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 6.4e+35) tmp = Float64(Float64(t * x) / Float64(z - y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * ((x / -y) - -1.0); tmp = 0.0; if (y <= -7e+111) tmp = t_1; elseif (y <= -3.05e+63) tmp = t * ((x - y) / z); elseif (y <= 1.85e-265) tmp = x * (t / (z - y)); elseif (y <= 6.4e+35) 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[(N[(x / (-y)), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7e+111], t$95$1, If[LessEqual[y, -3.05e+63], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e-265], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.4e+35], N[(N[(t * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(\frac{x}{-y} - -1\right)\\
\mathbf{if}\;y \leq -7 \cdot 10^{+111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.05 \cdot 10^{+63}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{-265}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{+35}:\\
\;\;\;\;\frac{t \cdot x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.0000000000000004e111 or 6.39999999999999965e35 < y Initial program 99.8%
Taylor expanded in z around 0 83.5%
mul-1-neg83.5%
div-sub83.5%
sub-neg83.5%
*-inverses83.5%
metadata-eval83.5%
Simplified83.5%
if -7.0000000000000004e111 < y < -3.04999999999999984e63Initial program 99.9%
Taylor expanded in z around inf 80.8%
if -3.04999999999999984e63 < y < 1.8499999999999999e-265Initial program 90.9%
Taylor expanded in x around inf 74.4%
associate-*l/76.7%
associate-/l*82.4%
Applied egg-rr82.4%
if 1.8499999999999999e-265 < y < 6.39999999999999965e35Initial program 93.0%
Taylor expanded in x around inf 79.7%
Final simplification82.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.2e+46)
(* t (/ y (- y z)))
(if (<= y 2.6e-265)
(* x (/ t (- z y)))
(if (<= y 7.8e+34) (/ (* t x) (- z y)) (* t (- (/ x (- y)) -1.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.2e+46) {
tmp = t * (y / (y - z));
} else if (y <= 2.6e-265) {
tmp = x * (t / (z - y));
} else if (y <= 7.8e+34) {
tmp = (t * x) / (z - y);
} else {
tmp = t * ((x / -y) - -1.0);
}
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.2d+46)) then
tmp = t * (y / (y - z))
else if (y <= 2.6d-265) then
tmp = x * (t / (z - y))
else if (y <= 7.8d+34) then
tmp = (t * x) / (z - y)
else
tmp = t * ((x / -y) - (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.2e+46) {
tmp = t * (y / (y - z));
} else if (y <= 2.6e-265) {
tmp = x * (t / (z - y));
} else if (y <= 7.8e+34) {
tmp = (t * x) / (z - y);
} else {
tmp = t * ((x / -y) - -1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.2e+46: tmp = t * (y / (y - z)) elif y <= 2.6e-265: tmp = x * (t / (z - y)) elif y <= 7.8e+34: tmp = (t * x) / (z - y) else: tmp = t * ((x / -y) - -1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.2e+46) tmp = Float64(t * Float64(y / Float64(y - z))); elseif (y <= 2.6e-265) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 7.8e+34) tmp = Float64(Float64(t * x) / Float64(z - y)); else tmp = Float64(t * Float64(Float64(x / Float64(-y)) - -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.2e+46) tmp = t * (y / (y - z)); elseif (y <= 2.6e-265) tmp = x * (t / (z - y)); elseif (y <= 7.8e+34) tmp = (t * x) / (z - y); else tmp = t * ((x / -y) - -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.2e+46], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e-265], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e+34], N[(N[(t * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(x / (-y)), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{+46}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-265}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+34}:\\
\;\;\;\;\frac{t \cdot x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{x}{-y} - -1\right)\\
\end{array}
\end{array}
if y < -3.1999999999999998e46Initial program 100.0%
Taylor expanded in x around 0 89.7%
neg-mul-189.7%
distribute-neg-frac89.7%
Simplified89.7%
if -3.1999999999999998e46 < y < 2.6000000000000001e-265Initial program 90.7%
Taylor expanded in x around inf 75.0%
associate-*l/77.3%
associate-/l*83.2%
Applied egg-rr83.2%
if 2.6000000000000001e-265 < y < 7.80000000000000038e34Initial program 93.0%
Taylor expanded in x around inf 79.7%
if 7.80000000000000038e34 < y Initial program 99.7%
Taylor expanded in z around 0 77.3%
mul-1-neg77.3%
div-sub77.4%
sub-neg77.4%
*-inverses77.4%
metadata-eval77.4%
Simplified77.4%
Final simplification82.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.8e+46)
(* t (/ y (- y z)))
(if (<= y 1.2e-265)
(* x (/ t (- z y)))
(if (<= y 1e+36) (/ (* t x) (- z y)) (/ t (/ y (- y x)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.8e+46) {
tmp = t * (y / (y - z));
} else if (y <= 1.2e-265) {
tmp = x * (t / (z - y));
} else if (y <= 1e+36) {
tmp = (t * x) / (z - y);
} else {
tmp = t / (y / (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 <= (-2.8d+46)) then
tmp = t * (y / (y - z))
else if (y <= 1.2d-265) then
tmp = x * (t / (z - y))
else if (y <= 1d+36) then
tmp = (t * x) / (z - y)
else
tmp = t / (y / (y - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.8e+46) {
tmp = t * (y / (y - z));
} else if (y <= 1.2e-265) {
tmp = x * (t / (z - y));
} else if (y <= 1e+36) {
tmp = (t * x) / (z - y);
} else {
tmp = t / (y / (y - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.8e+46: tmp = t * (y / (y - z)) elif y <= 1.2e-265: tmp = x * (t / (z - y)) elif y <= 1e+36: tmp = (t * x) / (z - y) else: tmp = t / (y / (y - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.8e+46) tmp = Float64(t * Float64(y / Float64(y - z))); elseif (y <= 1.2e-265) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 1e+36) tmp = Float64(Float64(t * x) / Float64(z - y)); else tmp = Float64(t / Float64(y / Float64(y - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.8e+46) tmp = t * (y / (y - z)); elseif (y <= 1.2e-265) tmp = x * (t / (z - y)); elseif (y <= 1e+36) tmp = (t * x) / (z - y); else tmp = t / (y / (y - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.8e+46], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e-265], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+36], N[(N[(t * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(t / N[(y / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+46}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-265}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 10^{+36}:\\
\;\;\;\;\frac{t \cdot x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{y}{y - x}}\\
\end{array}
\end{array}
if y < -2.80000000000000018e46Initial program 100.0%
Taylor expanded in x around 0 89.7%
neg-mul-189.7%
distribute-neg-frac89.7%
Simplified89.7%
if -2.80000000000000018e46 < y < 1.2e-265Initial program 90.7%
Taylor expanded in x around inf 75.0%
associate-*l/77.3%
associate-/l*83.2%
Applied egg-rr83.2%
if 1.2e-265 < y < 1.00000000000000004e36Initial program 93.0%
Taylor expanded in x around inf 79.7%
if 1.00000000000000004e36 < y Initial program 99.7%
*-commutative99.7%
clear-num99.7%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 77.4%
neg-mul-177.4%
distribute-neg-frac277.4%
Simplified77.4%
Final simplification82.9%
(FPCore (x y z t) :precision binary64 (if (<= y -2.05e+114) t (if (<= y -8.5e-24) (* x (/ t (- y))) (if (<= y 3.5e+36) (* t (/ x z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.05e+114) {
tmp = t;
} else if (y <= -8.5e-24) {
tmp = x * (t / -y);
} else if (y <= 3.5e+36) {
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 <= (-2.05d+114)) then
tmp = t
else if (y <= (-8.5d-24)) then
tmp = x * (t / -y)
else if (y <= 3.5d+36) 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 <= -2.05e+114) {
tmp = t;
} else if (y <= -8.5e-24) {
tmp = x * (t / -y);
} else if (y <= 3.5e+36) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.05e+114: tmp = t elif y <= -8.5e-24: tmp = x * (t / -y) elif y <= 3.5e+36: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.05e+114) tmp = t; elseif (y <= -8.5e-24) tmp = Float64(x * Float64(t / Float64(-y))); elseif (y <= 3.5e+36) 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 <= -2.05e+114) tmp = t; elseif (y <= -8.5e-24) tmp = x * (t / -y); elseif (y <= 3.5e+36) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.05e+114], t, If[LessEqual[y, -8.5e-24], N[(x * N[(t / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+36], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{+114}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{-24}:\\
\;\;\;\;x \cdot \frac{t}{-y}\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+36}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.05e114 or 3.4999999999999998e36 < y Initial program 99.8%
Taylor expanded in y around inf 70.7%
if -2.05e114 < y < -8.5000000000000002e-24Initial program 99.8%
Taylor expanded in x around inf 62.9%
associate-*l/62.9%
associate-/l*59.0%
Applied egg-rr59.0%
Taylor expanded in z around 0 51.8%
associate-*r/51.8%
neg-mul-151.8%
Simplified51.8%
if -8.5000000000000002e-24 < y < 3.4999999999999998e36Initial program 91.0%
Taylor expanded in y around 0 64.9%
Final simplification66.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.9e+113) (not (<= y 1e+164))) t (/ (* t x) (- z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.9e+113) || !(y <= 1e+164)) {
tmp = t;
} 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 <= (-5.9d+113)) .or. (.not. (y <= 1d+164))) then
tmp = t
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 <= -5.9e+113) || !(y <= 1e+164)) {
tmp = t;
} else {
tmp = (t * x) / (z - y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.9e+113) or not (y <= 1e+164): tmp = t else: tmp = (t * x) / (z - y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.9e+113) || !(y <= 1e+164)) tmp = t; else tmp = Float64(Float64(t * x) / Float64(z - y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5.9e+113) || ~((y <= 1e+164))) tmp = t; else tmp = (t * x) / (z - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.9e+113], N[Not[LessEqual[y, 1e+164]], $MachinePrecision]], t, N[(N[(t * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.9 \cdot 10^{+113} \lor \neg \left(y \leq 10^{+164}\right):\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot x}{z - y}\\
\end{array}
\end{array}
if y < -5.90000000000000023e113 or 1e164 < y Initial program 99.9%
Taylor expanded in y around inf 80.5%
if -5.90000000000000023e113 < y < 1e164Initial program 93.2%
Taylor expanded in x around inf 73.6%
Final simplification76.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.4e+114) (not (<= y 3e+163))) t (* x (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.4e+114) || !(y <= 3e+163)) {
tmp = t;
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-2.4d+114)) .or. (.not. (y <= 3d+163))) then
tmp = t
else
tmp = x * (t / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.4e+114) || !(y <= 3e+163)) {
tmp = t;
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.4e+114) or not (y <= 3e+163): tmp = t else: tmp = x * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.4e+114) || !(y <= 3e+163)) tmp = t; else tmp = Float64(x * Float64(t / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.4e+114) || ~((y <= 3e+163))) tmp = t; else tmp = x * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.4e+114], N[Not[LessEqual[y, 3e+163]], $MachinePrecision]], t, N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+114} \lor \neg \left(y \leq 3 \cdot 10^{+163}\right):\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -2.4e114 or 3.00000000000000013e163 < y Initial program 99.9%
Taylor expanded in y around inf 80.5%
if -2.4e114 < y < 3.00000000000000013e163Initial program 93.2%
Taylor expanded in x around inf 70.8%
associate-*l/73.6%
associate-/l*73.0%
Applied egg-rr73.0%
Final simplification75.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.2e+101) (not (<= y 1.7e+40))) t (* t (/ x z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.2e+101) || !(y <= 1.7e+40)) {
tmp = t;
} else {
tmp = t * (x / 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 <= (-5.2d+101)) .or. (.not. (y <= 1.7d+40))) then
tmp = t
else
tmp = t * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.2e+101) || !(y <= 1.7e+40)) {
tmp = t;
} else {
tmp = t * (x / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.2e+101) or not (y <= 1.7e+40): tmp = t else: tmp = t * (x / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.2e+101) || !(y <= 1.7e+40)) tmp = t; else tmp = Float64(t * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5.2e+101) || ~((y <= 1.7e+40))) tmp = t; else tmp = t * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.2e+101], N[Not[LessEqual[y, 1.7e+40]], $MachinePrecision]], t, N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+101} \lor \neg \left(y \leq 1.7 \cdot 10^{+40}\right):\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\end{array}
\end{array}
if y < -5.2e101 or 1.69999999999999994e40 < y Initial program 99.8%
Taylor expanded in y around inf 68.8%
if -5.2e101 < y < 1.69999999999999994e40Initial program 92.3%
Taylor expanded in y around 0 60.6%
Final simplification64.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.2e+101) (not (<= y 3.8e+37))) t (* x (/ t z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.2e+101) || !(y <= 3.8e+37)) {
tmp = t;
} else {
tmp = x * (t / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-5.2d+101)) .or. (.not. (y <= 3.8d+37))) then
tmp = t
else
tmp = x * (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.2e+101) || !(y <= 3.8e+37)) {
tmp = t;
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.2e+101) or not (y <= 3.8e+37): tmp = t else: tmp = x * (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.2e+101) || !(y <= 3.8e+37)) tmp = t; else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5.2e+101) || ~((y <= 3.8e+37))) tmp = t; else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.2e+101], N[Not[LessEqual[y, 3.8e+37]], $MachinePrecision]], t, N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+101} \lor \neg \left(y \leq 3.8 \cdot 10^{+37}\right):\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if y < -5.2e101 or 3.7999999999999999e37 < y Initial program 99.8%
Taylor expanded in y around inf 68.8%
if -5.2e101 < y < 3.7999999999999999e37Initial program 92.3%
Taylor expanded in y around 0 60.6%
associate-*l/59.4%
associate-/l*58.0%
Applied egg-rr58.0%
Final simplification62.6%
(FPCore (x y z t) :precision binary64 (* t (/ (- x y) (- z y))))
double code(double x, double y, double z, double t) {
return t * ((x - y) / (z - y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t * ((x - y) / (z - y))
end function
public static double code(double x, double y, double z, double t) {
return t * ((x - y) / (z - y));
}
def code(x, y, z, t): return t * ((x - y) / (z - y))
function code(x, y, z, t) return Float64(t * Float64(Float64(x - y) / Float64(z - y))) end
function tmp = code(x, y, z, t) tmp = t * ((x - y) / (z - y)); end
code[x_, y_, z_, t_] := N[(t * N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \frac{x - y}{z - y}
\end{array}
Initial program 95.5%
Final simplification95.5%
(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 95.5%
Taylor expanded in y around inf 37.4%
(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 2024096
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:alt
(/ t (/ (- z y) (- x y)))
(* (/ (- x y) (- z y)) t))