
(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 (* (/ (- 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.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -7.5e+108)
t
(if (<= y -1.05e-76)
(* (- x y) (/ t z))
(if (<= y 1.6e-32)
(* x (/ t (- z y)))
(if (<= y 4.4e+148) (* y (/ t (- y z))) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e+108) {
tmp = t;
} else if (y <= -1.05e-76) {
tmp = (x - y) * (t / z);
} else if (y <= 1.6e-32) {
tmp = x * (t / (z - y));
} else if (y <= 4.4e+148) {
tmp = y * (t / (y - z));
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-7.5d+108)) then
tmp = t
else if (y <= (-1.05d-76)) then
tmp = (x - y) * (t / z)
else if (y <= 1.6d-32) then
tmp = x * (t / (z - y))
else if (y <= 4.4d+148) then
tmp = y * (t / (y - z))
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e+108) {
tmp = t;
} else if (y <= -1.05e-76) {
tmp = (x - y) * (t / z);
} else if (y <= 1.6e-32) {
tmp = x * (t / (z - y));
} else if (y <= 4.4e+148) {
tmp = y * (t / (y - z));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.5e+108: tmp = t elif y <= -1.05e-76: tmp = (x - y) * (t / z) elif y <= 1.6e-32: tmp = x * (t / (z - y)) elif y <= 4.4e+148: tmp = y * (t / (y - z)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.5e+108) tmp = t; elseif (y <= -1.05e-76) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (y <= 1.6e-32) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 4.4e+148) tmp = Float64(y * Float64(t / Float64(y - z))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7.5e+108) tmp = t; elseif (y <= -1.05e-76) tmp = (x - y) * (t / z); elseif (y <= 1.6e-32) tmp = x * (t / (z - y)); elseif (y <= 4.4e+148) tmp = y * (t / (y - z)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.5e+108], t, If[LessEqual[y, -1.05e-76], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-32], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.4e+148], N[(y * N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+108}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-76}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-32}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{+148}:\\
\;\;\;\;y \cdot \frac{t}{y - z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.50000000000000039e108 or 4.3999999999999998e148 < y Initial program 99.9%
associate-*l/75.0%
associate-/l*58.3%
Simplified58.3%
Taylor expanded in y around inf 75.0%
if -7.50000000000000039e108 < y < -1.04999999999999996e-76Initial program 97.1%
associate-*l/90.4%
associate-/l*88.1%
Simplified88.1%
Taylor expanded in z around inf 58.8%
if -1.04999999999999996e-76 < y < 1.6000000000000001e-32Initial program 93.5%
associate-*l/91.6%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in x around inf 87.8%
if 1.6000000000000001e-32 < y < 4.3999999999999998e148Initial program 99.8%
associate-*l/89.9%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in x around 0 74.4%
associate-*r/74.4%
mul-1-neg74.4%
distribute-rgt-neg-out74.4%
associate-*l/74.8%
*-commutative74.8%
distribute-lft-neg-out74.8%
distribute-rgt-neg-in74.8%
distribute-frac-neg274.8%
neg-sub074.8%
sub-neg74.8%
+-commutative74.8%
associate--r+74.8%
neg-sub074.8%
remove-double-neg74.8%
Simplified74.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.2e-30)
(/ t (/ y (- y x)))
(if (<= y -1.05e-76)
(* (- x y) (/ t z))
(if (<= y 2.2e-37) (* x (/ t (- z y))) (* t (/ y (- y z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.2e-30) {
tmp = t / (y / (y - x));
} else if (y <= -1.05e-76) {
tmp = (x - y) * (t / z);
} else if (y <= 2.2e-37) {
tmp = x * (t / (z - y));
} else {
tmp = t * (y / (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 <= (-2.2d-30)) then
tmp = t / (y / (y - x))
else if (y <= (-1.05d-76)) then
tmp = (x - y) * (t / z)
else if (y <= 2.2d-37) then
tmp = x * (t / (z - y))
else
tmp = t * (y / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.2e-30) {
tmp = t / (y / (y - x));
} else if (y <= -1.05e-76) {
tmp = (x - y) * (t / z);
} else if (y <= 2.2e-37) {
tmp = x * (t / (z - y));
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.2e-30: tmp = t / (y / (y - x)) elif y <= -1.05e-76: tmp = (x - y) * (t / z) elif y <= 2.2e-37: tmp = x * (t / (z - y)) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.2e-30) tmp = Float64(t / Float64(y / Float64(y - x))); elseif (y <= -1.05e-76) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (y <= 2.2e-37) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = Float64(t * Float64(y / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.2e-30) tmp = t / (y / (y - x)); elseif (y <= -1.05e-76) tmp = (x - y) * (t / z); elseif (y <= 2.2e-37) tmp = x * (t / (z - y)); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.2e-30], N[(t / N[(y / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.05e-76], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e-37], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-30}:\\
\;\;\;\;\frac{t}{\frac{y}{y - x}}\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-76}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-37}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if y < -2.19999999999999983e-30Initial program 99.8%
associate-*l/78.7%
associate-/l*76.6%
Simplified76.6%
associate-*r/78.7%
associate-*l/99.8%
*-commutative99.8%
clear-num99.7%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 75.1%
neg-mul-175.1%
distribute-neg-frac275.1%
sub-neg75.1%
distribute-neg-in75.1%
remove-double-neg75.1%
Simplified75.1%
Taylor expanded in x around 0 75.1%
mul-1-neg75.1%
sub-neg75.1%
Simplified75.1%
if -2.19999999999999983e-30 < y < -1.04999999999999996e-76Initial program 91.8%
associate-*l/85.6%
associate-/l*90.9%
Simplified90.9%
Taylor expanded in z around inf 83.2%
if -1.04999999999999996e-76 < y < 2.20000000000000002e-37Initial program 93.5%
associate-*l/91.6%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in x around inf 87.8%
if 2.20000000000000002e-37 < y Initial program 99.9%
Taylor expanded in x around 0 84.7%
neg-mul-184.7%
distribute-neg-frac284.7%
neg-sub084.7%
sub-neg84.7%
+-commutative84.7%
associate--r+84.7%
neg-sub084.7%
remove-double-neg84.7%
Simplified84.7%
Final simplification83.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.55e-30)
(* t (/ (- y x) y))
(if (<= y -1.26e-76)
(* (- x y) (/ t z))
(if (<= y 4.8e-30) (* x (/ t (- z y))) (* t (/ y (- y z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.55e-30) {
tmp = t * ((y - x) / y);
} else if (y <= -1.26e-76) {
tmp = (x - y) * (t / z);
} else if (y <= 4.8e-30) {
tmp = x * (t / (z - y));
} else {
tmp = t * (y / (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 <= (-1.55d-30)) then
tmp = t * ((y - x) / y)
else if (y <= (-1.26d-76)) then
tmp = (x - y) * (t / z)
else if (y <= 4.8d-30) then
tmp = x * (t / (z - y))
else
tmp = t * (y / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.55e-30) {
tmp = t * ((y - x) / y);
} else if (y <= -1.26e-76) {
tmp = (x - y) * (t / z);
} else if (y <= 4.8e-30) {
tmp = x * (t / (z - y));
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.55e-30: tmp = t * ((y - x) / y) elif y <= -1.26e-76: tmp = (x - y) * (t / z) elif y <= 4.8e-30: tmp = x * (t / (z - y)) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.55e-30) tmp = Float64(t * Float64(Float64(y - x) / y)); elseif (y <= -1.26e-76) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (y <= 4.8e-30) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = Float64(t * Float64(y / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.55e-30) tmp = t * ((y - x) / y); elseif (y <= -1.26e-76) tmp = (x - y) * (t / z); elseif (y <= 4.8e-30) tmp = x * (t / (z - y)); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.55e-30], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.26e-76], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e-30], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{-30}:\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\mathbf{elif}\;y \leq -1.26 \cdot 10^{-76}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-30}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if y < -1.54999999999999995e-30Initial program 99.8%
Taylor expanded in z around 0 75.0%
associate-*r/75.0%
neg-mul-175.0%
neg-sub075.0%
sub-neg75.0%
+-commutative75.0%
associate--r+75.0%
neg-sub075.0%
remove-double-neg75.0%
Simplified75.0%
if -1.54999999999999995e-30 < y < -1.26e-76Initial program 91.8%
associate-*l/85.6%
associate-/l*90.9%
Simplified90.9%
Taylor expanded in z around inf 83.2%
if -1.26e-76 < y < 4.7999999999999997e-30Initial program 93.5%
associate-*l/91.6%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in x around inf 87.8%
if 4.7999999999999997e-30 < y Initial program 99.9%
Taylor expanded in x around 0 84.7%
neg-mul-184.7%
distribute-neg-frac284.7%
neg-sub084.7%
sub-neg84.7%
+-commutative84.7%
associate--r+84.7%
neg-sub084.7%
remove-double-neg84.7%
Simplified84.7%
Final simplification83.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.5e+107)
t
(if (<= y 1.45e-31)
(* x (/ t (- z y)))
(if (<= y 4.4e+148) (* y (/ t (- y z))) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e+107) {
tmp = t;
} else if (y <= 1.45e-31) {
tmp = x * (t / (z - y));
} else if (y <= 4.4e+148) {
tmp = y * (t / (y - z));
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.5d+107)) then
tmp = t
else if (y <= 1.45d-31) then
tmp = x * (t / (z - y))
else if (y <= 4.4d+148) then
tmp = y * (t / (y - z))
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e+107) {
tmp = t;
} else if (y <= 1.45e-31) {
tmp = x * (t / (z - y));
} else if (y <= 4.4e+148) {
tmp = y * (t / (y - z));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.5e+107: tmp = t elif y <= 1.45e-31: tmp = x * (t / (z - y)) elif y <= 4.4e+148: tmp = y * (t / (y - z)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.5e+107) tmp = t; elseif (y <= 1.45e-31) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 4.4e+148) tmp = Float64(y * Float64(t / Float64(y - z))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.5e+107) tmp = t; elseif (y <= 1.45e-31) tmp = x * (t / (z - y)); elseif (y <= 4.4e+148) tmp = y * (t / (y - z)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.5e+107], t, If[LessEqual[y, 1.45e-31], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.4e+148], N[(y * N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+107}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{-31}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{+148}:\\
\;\;\;\;y \cdot \frac{t}{y - z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.4999999999999997e107 or 4.3999999999999998e148 < y Initial program 99.9%
associate-*l/75.0%
associate-/l*58.3%
Simplified58.3%
Taylor expanded in y around inf 75.0%
if -3.4999999999999997e107 < y < 1.45e-31Initial program 94.4%
associate-*l/91.3%
associate-/l*91.7%
Simplified91.7%
Taylor expanded in x around inf 77.1%
if 1.45e-31 < y < 4.3999999999999998e148Initial program 99.8%
associate-*l/89.9%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in x around 0 74.4%
associate-*r/74.4%
mul-1-neg74.4%
distribute-rgt-neg-out74.4%
associate-*l/74.8%
*-commutative74.8%
distribute-lft-neg-out74.8%
distribute-rgt-neg-in74.8%
distribute-frac-neg274.8%
neg-sub074.8%
sub-neg74.8%
+-commutative74.8%
associate--r+74.8%
neg-sub074.8%
remove-double-neg74.8%
Simplified74.8%
(FPCore (x y z t) :precision binary64 (if (<= y -8.2e+149) (/ t (/ y (- y x))) (if (<= y 8.5e+148) (* (- x y) (/ t (- z y))) (* t (/ y (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.2e+149) {
tmp = t / (y / (y - x));
} else if (y <= 8.5e+148) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t * (y / (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 <= (-8.2d+149)) then
tmp = t / (y / (y - x))
else if (y <= 8.5d+148) then
tmp = (x - y) * (t / (z - y))
else
tmp = t * (y / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.2e+149) {
tmp = t / (y / (y - x));
} else if (y <= 8.5e+148) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.2e+149: tmp = t / (y / (y - x)) elif y <= 8.5e+148: tmp = (x - y) * (t / (z - y)) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.2e+149) tmp = Float64(t / Float64(y / Float64(y - x))); elseif (y <= 8.5e+148) tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); else tmp = Float64(t * Float64(y / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8.2e+149) tmp = t / (y / (y - x)); elseif (y <= 8.5e+148) tmp = (x - y) * (t / (z - y)); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.2e+149], N[(t / N[(y / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+148], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{+149}:\\
\;\;\;\;\frac{t}{\frac{y}{y - x}}\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+148}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if y < -8.1999999999999992e149Initial program 99.9%
associate-*l/68.0%
associate-/l*66.0%
Simplified66.0%
associate-*r/68.0%
associate-*l/99.9%
*-commutative99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in z around 0 91.1%
neg-mul-191.1%
distribute-neg-frac291.1%
sub-neg91.1%
distribute-neg-in91.1%
remove-double-neg91.1%
Simplified91.1%
Taylor expanded in x around 0 91.1%
mul-1-neg91.1%
sub-neg91.1%
Simplified91.1%
if -8.1999999999999992e149 < y < 8.4999999999999996e148Initial program 95.8%
associate-*l/90.0%
associate-/l*91.7%
Simplified91.7%
if 8.4999999999999996e148 < y Initial program 100.0%
Taylor expanded in x around 0 91.1%
neg-mul-191.1%
distribute-neg-frac291.1%
neg-sub091.1%
sub-neg91.1%
+-commutative91.1%
associate--r+91.1%
neg-sub091.1%
remove-double-neg91.1%
Simplified91.1%
Final simplification91.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.5e+105) (not (<= y 1.4e-33))) (* t (/ y (- y z))) (* x (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.5e+105) || !(y <= 1.4e-33)) {
tmp = t * (y / (y - z));
} 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 <= (-1.5d+105)) .or. (.not. (y <= 1.4d-33))) then
tmp = t * (y / (y - z))
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 <= -1.5e+105) || !(y <= 1.4e-33)) {
tmp = t * (y / (y - z));
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.5e+105) or not (y <= 1.4e-33): tmp = t * (y / (y - z)) else: tmp = x * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.5e+105) || !(y <= 1.4e-33)) tmp = Float64(t * Float64(y / Float64(y - z))); 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 <= -1.5e+105) || ~((y <= 1.4e-33))) tmp = t * (y / (y - z)); else tmp = x * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.5e+105], N[Not[LessEqual[y, 1.4e-33]], $MachinePrecision]], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+105} \lor \neg \left(y \leq 1.4 \cdot 10^{-33}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -1.5e105 or 1.4e-33 < y Initial program 99.9%
Taylor expanded in x around 0 84.3%
neg-mul-184.3%
distribute-neg-frac284.3%
neg-sub084.3%
sub-neg84.3%
+-commutative84.3%
associate--r+84.3%
neg-sub084.3%
remove-double-neg84.3%
Simplified84.3%
if -1.5e105 < y < 1.4e-33Initial program 94.4%
associate-*l/91.2%
associate-/l*91.7%
Simplified91.7%
Taylor expanded in x around inf 77.6%
Final simplification80.6%
(FPCore (x y z t) :precision binary64 (if (<= y -6.6e-37) (/ t (/ y (- y x))) (if (<= y 5e-34) (/ t (/ (- z y) x)) (* t (/ y (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.6e-37) {
tmp = t / (y / (y - x));
} else if (y <= 5e-34) {
tmp = t / ((z - y) / x);
} else {
tmp = t * (y / (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 <= (-6.6d-37)) then
tmp = t / (y / (y - x))
else if (y <= 5d-34) then
tmp = t / ((z - y) / x)
else
tmp = t * (y / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.6e-37) {
tmp = t / (y / (y - x));
} else if (y <= 5e-34) {
tmp = t / ((z - y) / x);
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.6e-37: tmp = t / (y / (y - x)) elif y <= 5e-34: tmp = t / ((z - y) / x) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.6e-37) tmp = Float64(t / Float64(y / Float64(y - x))); elseif (y <= 5e-34) tmp = Float64(t / Float64(Float64(z - y) / x)); else tmp = Float64(t * Float64(y / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.6e-37) tmp = t / (y / (y - x)); elseif (y <= 5e-34) tmp = t / ((z - y) / x); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.6e-37], N[(t / N[(y / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-34], N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{-37}:\\
\;\;\;\;\frac{t}{\frac{y}{y - x}}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-34}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if y < -6.59999999999999964e-37Initial program 99.8%
associate-*l/79.1%
associate-/l*76.9%
Simplified76.9%
associate-*r/79.1%
associate-*l/99.8%
*-commutative99.8%
clear-num99.7%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 74.1%
neg-mul-174.1%
distribute-neg-frac274.1%
sub-neg74.1%
distribute-neg-in74.1%
remove-double-neg74.1%
Simplified74.1%
Taylor expanded in x around 0 74.1%
mul-1-neg74.1%
sub-neg74.1%
Simplified74.1%
if -6.59999999999999964e-37 < y < 5.0000000000000003e-34Initial program 93.2%
associate-*l/90.9%
associate-/l*92.8%
Simplified92.8%
associate-*r/90.9%
associate-*l/93.2%
*-commutative93.2%
clear-num93.1%
un-div-inv93.2%
Applied egg-rr93.2%
Taylor expanded in x around inf 85.1%
if 5.0000000000000003e-34 < y Initial program 99.9%
Taylor expanded in x around 0 84.7%
neg-mul-184.7%
distribute-neg-frac284.7%
neg-sub084.7%
sub-neg84.7%
+-commutative84.7%
associate--r+84.7%
neg-sub084.7%
remove-double-neg84.7%
Simplified84.7%
Final simplification82.1%
(FPCore (x y z t) :precision binary64 (if (<= y -4.2e+113) t (if (<= y 5.2e-30) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.2e+113) {
tmp = t;
} else if (y <= 5.2e-30) {
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 <= (-4.2d+113)) then
tmp = t
else if (y <= 5.2d-30) 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 <= -4.2e+113) {
tmp = t;
} else if (y <= 5.2e-30) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.2e+113: tmp = t elif y <= 5.2e-30: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.2e+113) tmp = t; elseif (y <= 5.2e-30) 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 <= -4.2e+113) tmp = t; elseif (y <= 5.2e-30) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.2e+113], t, If[LessEqual[y, 5.2e-30], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+113}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-30}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -4.1999999999999998e113 or 5.19999999999999973e-30 < y Initial program 99.9%
associate-*l/80.0%
associate-/l*69.8%
Simplified69.8%
Taylor expanded in y around inf 65.7%
if -4.1999999999999998e113 < y < 5.19999999999999973e-30Initial program 94.4%
associate-*l/91.3%
associate-/l*91.7%
Simplified91.7%
Taylor expanded in x around inf 77.1%
(FPCore (x y z t) :precision binary64 (if (<= y -7.6e+96) t (if (<= y 2.95e-44) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.6e+96) {
tmp = t;
} else if (y <= 2.95e-44) {
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 <= (-7.6d+96)) then
tmp = t
else if (y <= 2.95d-44) 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 <= -7.6e+96) {
tmp = t;
} else if (y <= 2.95e-44) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.6e+96: tmp = t elif y <= 2.95e-44: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.6e+96) tmp = t; elseif (y <= 2.95e-44) 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 <= -7.6e+96) tmp = t; elseif (y <= 2.95e-44) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.6e+96], t, If[LessEqual[y, 2.95e-44], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+96}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.95 \cdot 10^{-44}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.6000000000000003e96 or 2.95000000000000018e-44 < y Initial program 99.9%
associate-*l/80.5%
associate-/l*70.5%
Simplified70.5%
Taylor expanded in y around inf 64.0%
if -7.6000000000000003e96 < y < 2.95000000000000018e-44Initial program 94.3%
Taylor expanded in y around 0 67.1%
Final simplification65.7%
(FPCore (x y z t) :precision binary64 (if (<= y -2.3e+34) t (if (<= y 2.75e-44) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.3e+34) {
tmp = t;
} else if (y <= 2.75e-44) {
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 <= (-2.3d+34)) then
tmp = t
else if (y <= 2.75d-44) 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 <= -2.3e+34) {
tmp = t;
} else if (y <= 2.75e-44) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.3e+34: tmp = t elif y <= 2.75e-44: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.3e+34) tmp = t; elseif (y <= 2.75e-44) 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 <= -2.3e+34) tmp = t; elseif (y <= 2.75e-44) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.3e+34], t, If[LessEqual[y, 2.75e-44], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+34}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.75 \cdot 10^{-44}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.2999999999999998e34 or 2.74999999999999996e-44 < y Initial program 99.8%
associate-*l/81.3%
associate-/l*71.3%
Simplified71.3%
Taylor expanded in y around inf 60.2%
if -2.2999999999999998e34 < y < 2.74999999999999996e-44Initial program 93.7%
associate-*l/91.6%
associate-/l*93.3%
Simplified93.3%
Taylor expanded in x around inf 81.3%
Taylor expanded in z around inf 68.9%
(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.8%
associate-*l/86.3%
associate-/l*82.0%
Simplified82.0%
Taylor expanded in y around inf 33.7%
(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 2024139
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:alt
(! :herbie-platform default (/ t (/ (- z y) (- x y))))
(* (/ (- x y) (- z y)) t))