
(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.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (/ t (- y z)))) (t_2 (* t (- 1.0 (/ x y)))))
(if (<= y -510000000.0)
t_2
(if (<= y -1.36e-76)
t_1
(if (<= y 58000.0) (* x (/ t (- z y))) (if (<= y 2.8e+92) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t / (y - z));
double t_2 = t * (1.0 - (x / y));
double tmp;
if (y <= -510000000.0) {
tmp = t_2;
} else if (y <= -1.36e-76) {
tmp = t_1;
} else if (y <= 58000.0) {
tmp = x * (t / (z - y));
} else if (y <= 2.8e+92) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = y * (t / (y - z))
t_2 = t * (1.0d0 - (x / y))
if (y <= (-510000000.0d0)) then
tmp = t_2
else if (y <= (-1.36d-76)) then
tmp = t_1
else if (y <= 58000.0d0) then
tmp = x * (t / (z - y))
else if (y <= 2.8d+92) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (t / (y - z));
double t_2 = t * (1.0 - (x / y));
double tmp;
if (y <= -510000000.0) {
tmp = t_2;
} else if (y <= -1.36e-76) {
tmp = t_1;
} else if (y <= 58000.0) {
tmp = x * (t / (z - y));
} else if (y <= 2.8e+92) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t / (y - z)) t_2 = t * (1.0 - (x / y)) tmp = 0 if y <= -510000000.0: tmp = t_2 elif y <= -1.36e-76: tmp = t_1 elif y <= 58000.0: tmp = x * (t / (z - y)) elif y <= 2.8e+92: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t / Float64(y - z))) t_2 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (y <= -510000000.0) tmp = t_2; elseif (y <= -1.36e-76) tmp = t_1; elseif (y <= 58000.0) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 2.8e+92) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t / (y - z)); t_2 = t * (1.0 - (x / y)); tmp = 0.0; if (y <= -510000000.0) tmp = t_2; elseif (y <= -1.36e-76) tmp = t_1; elseif (y <= 58000.0) tmp = x * (t / (z - y)); elseif (y <= 2.8e+92) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -510000000.0], t$95$2, If[LessEqual[y, -1.36e-76], t$95$1, If[LessEqual[y, 58000.0], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+92], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{t}{y - z}\\
t_2 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -510000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.36 \cdot 10^{-76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 58000:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -5.1e8 or 2.80000000000000001e92 < y Initial program 99.9%
Taylor expanded in z around 0 81.9%
associate-*r/81.9%
neg-mul-181.9%
neg-sub081.9%
sub-neg81.9%
+-commutative81.9%
associate--r+81.9%
neg-sub081.9%
remove-double-neg81.9%
Simplified81.9%
Taylor expanded in y around 0 81.9%
neg-mul-181.9%
sub-neg81.9%
div-sub81.9%
*-inverses81.9%
Simplified81.9%
if -5.1e8 < y < -1.35999999999999993e-76 or 58000 < y < 2.80000000000000001e92Initial program 99.1%
associate-*l/93.0%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in x around 0 74.3%
associate-*r/74.3%
mul-1-neg74.3%
distribute-rgt-neg-out74.3%
associate-*l/76.1%
*-commutative76.1%
distribute-lft-neg-out76.1%
distribute-rgt-neg-in76.1%
distribute-frac-neg276.1%
neg-sub076.1%
sub-neg76.1%
+-commutative76.1%
associate--r+76.1%
neg-sub076.1%
remove-double-neg76.1%
Simplified76.1%
if -1.35999999999999993e-76 < y < 58000Initial program 93.0%
associate-*l/97.2%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in x around inf 77.5%
Final simplification79.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (/ t (- y z)))))
(if (<= y -8.5e+105)
t
(if (<= y -3.8e-76)
t_1
(if (<= y 110000.0) (* x (/ t (- z y))) (if (<= y 3.4e+199) t_1 t))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t / (y - z));
double tmp;
if (y <= -8.5e+105) {
tmp = t;
} else if (y <= -3.8e-76) {
tmp = t_1;
} else if (y <= 110000.0) {
tmp = x * (t / (z - y));
} else if (y <= 3.4e+199) {
tmp = t_1;
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = y * (t / (y - z))
if (y <= (-8.5d+105)) then
tmp = t
else if (y <= (-3.8d-76)) then
tmp = t_1
else if (y <= 110000.0d0) then
tmp = x * (t / (z - y))
else if (y <= 3.4d+199) then
tmp = t_1
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (t / (y - z));
double tmp;
if (y <= -8.5e+105) {
tmp = t;
} else if (y <= -3.8e-76) {
tmp = t_1;
} else if (y <= 110000.0) {
tmp = x * (t / (z - y));
} else if (y <= 3.4e+199) {
tmp = t_1;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t / (y - z)) tmp = 0 if y <= -8.5e+105: tmp = t elif y <= -3.8e-76: tmp = t_1 elif y <= 110000.0: tmp = x * (t / (z - y)) elif y <= 3.4e+199: tmp = t_1 else: tmp = t return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t / Float64(y - z))) tmp = 0.0 if (y <= -8.5e+105) tmp = t; elseif (y <= -3.8e-76) tmp = t_1; elseif (y <= 110000.0) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 3.4e+199) tmp = t_1; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t / (y - z)); tmp = 0.0; if (y <= -8.5e+105) tmp = t; elseif (y <= -3.8e-76) tmp = t_1; elseif (y <= 110000.0) tmp = x * (t / (z - y)); elseif (y <= 3.4e+199) tmp = t_1; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.5e+105], t, If[LessEqual[y, -3.8e-76], t$95$1, If[LessEqual[y, 110000.0], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e+199], t$95$1, t]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{t}{y - z}\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{+105}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 110000:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{+199}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -8.49999999999999986e105 or 3.4e199 < y Initial program 100.0%
associate-*l/67.6%
associate-/l*58.2%
Simplified58.2%
Taylor expanded in y around inf 80.6%
if -8.49999999999999986e105 < y < -3.8000000000000002e-76 or 1.1e5 < y < 3.4e199Initial program 99.4%
associate-*l/87.6%
associate-/l*89.6%
Simplified89.6%
Taylor expanded in x around 0 67.2%
associate-*r/67.2%
mul-1-neg67.2%
distribute-rgt-neg-out67.2%
associate-*l/68.5%
*-commutative68.5%
distribute-lft-neg-out68.5%
distribute-rgt-neg-in68.5%
distribute-frac-neg268.5%
neg-sub068.5%
sub-neg68.5%
+-commutative68.5%
associate--r+68.5%
neg-sub068.5%
remove-double-neg68.5%
Simplified68.5%
if -3.8000000000000002e-76 < y < 1.1e5Initial program 93.0%
associate-*l/97.2%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in x around inf 77.5%
(FPCore (x y z t) :precision binary64 (if (<= y -6e+122) (* t (/ y (- y z))) (if (<= y 1.9e+126) (* (- x y) (/ t (- z y))) (/ t (/ (- y z) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6e+122) {
tmp = t * (y / (y - z));
} else if (y <= 1.9e+126) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t / ((y - 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 <= (-6d+122)) then
tmp = t * (y / (y - z))
else if (y <= 1.9d+126) then
tmp = (x - y) * (t / (z - y))
else
tmp = t / ((y - z) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6e+122) {
tmp = t * (y / (y - z));
} else if (y <= 1.9e+126) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t / ((y - z) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6e+122: tmp = t * (y / (y - z)) elif y <= 1.9e+126: tmp = (x - y) * (t / (z - y)) else: tmp = t / ((y - z) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6e+122) tmp = Float64(t * Float64(y / Float64(y - z))); elseif (y <= 1.9e+126) tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); else tmp = Float64(t / Float64(Float64(y - z) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6e+122) tmp = t * (y / (y - z)); elseif (y <= 1.9e+126) tmp = (x - y) * (t / (z - y)); else tmp = t / ((y - z) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6e+122], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+126], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(N[(y - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{+122}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+126}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{y - z}{y}}\\
\end{array}
\end{array}
if y < -5.99999999999999972e122Initial program 100.0%
Taylor expanded in x around 0 91.7%
neg-mul-191.7%
distribute-neg-frac291.7%
neg-sub091.7%
sub-neg91.7%
+-commutative91.7%
associate--r+91.7%
neg-sub091.7%
remove-double-neg91.7%
Simplified91.7%
if -5.99999999999999972e122 < y < 1.90000000000000008e126Initial program 95.5%
associate-*l/95.1%
associate-/l*93.0%
Simplified93.0%
if 1.90000000000000008e126 < y Initial program 99.9%
associate-*l/69.9%
associate-/l*56.4%
Simplified56.4%
associate-*r/69.9%
associate-*l/99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 93.1%
mul-1-neg93.1%
div-sub93.0%
sub-neg93.0%
*-inverses93.0%
metadata-eval93.0%
Simplified93.0%
Taylor expanded in y around 0 93.1%
Final simplification92.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.2e-76) (not (<= y 54000.0))) (* t (/ y (- y z))) (/ (* x t) (- z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.2e-76) || !(y <= 54000.0)) {
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 <= (-4.2d-76)) .or. (.not. (y <= 54000.0d0))) 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 <= -4.2e-76) || !(y <= 54000.0)) {
tmp = t * (y / (y - z));
} else {
tmp = (x * t) / (z - y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.2e-76) or not (y <= 54000.0): tmp = t * (y / (y - z)) else: tmp = (x * t) / (z - y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.2e-76) || !(y <= 54000.0)) tmp = Float64(t * Float64(y / Float64(y - z))); else tmp = Float64(Float64(x * t) / Float64(z - y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4.2e-76) || ~((y <= 54000.0))) 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, -4.2e-76], N[Not[LessEqual[y, 54000.0]], $MachinePrecision]], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{-76} \lor \neg \left(y \leq 54000\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot t}{z - y}\\
\end{array}
\end{array}
if y < -4.19999999999999985e-76 or 54000 < y Initial program 99.6%
Taylor expanded in x around 0 82.4%
neg-mul-182.4%
distribute-neg-frac282.4%
neg-sub082.4%
sub-neg82.4%
+-commutative82.4%
associate--r+82.4%
neg-sub082.4%
remove-double-neg82.4%
Simplified82.4%
if -4.19999999999999985e-76 < y < 54000Initial program 93.0%
associate-*l/97.2%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in x around inf 80.3%
Final simplification81.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7.5e-77) (not (<= y 58000.0))) (* t (/ y (- y z))) (/ x (/ (- z y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.5e-77) || !(y <= 58000.0)) {
tmp = t * (y / (y - z));
} else {
tmp = x / ((z - y) / 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-77)) .or. (.not. (y <= 58000.0d0))) then
tmp = t * (y / (y - z))
else
tmp = x / ((z - y) / 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-77) || !(y <= 58000.0)) {
tmp = t * (y / (y - z));
} else {
tmp = x / ((z - y) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7.5e-77) or not (y <= 58000.0): tmp = t * (y / (y - z)) else: tmp = x / ((z - y) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7.5e-77) || !(y <= 58000.0)) tmp = Float64(t * Float64(y / Float64(y - z))); else tmp = Float64(x / Float64(Float64(z - y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -7.5e-77) || ~((y <= 58000.0))) tmp = t * (y / (y - z)); else tmp = x / ((z - y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.5e-77], N[Not[LessEqual[y, 58000.0]], $MachinePrecision]], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{-77} \lor \neg \left(y \leq 58000\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z - y}{t}}\\
\end{array}
\end{array}
if y < -7.5000000000000006e-77 or 58000 < y Initial program 99.6%
Taylor expanded in x around 0 82.4%
neg-mul-182.4%
distribute-neg-frac282.4%
neg-sub082.4%
sub-neg82.4%
+-commutative82.4%
associate--r+82.4%
neg-sub082.4%
remove-double-neg82.4%
Simplified82.4%
if -7.5000000000000006e-77 < y < 58000Initial program 93.0%
associate-*l/97.2%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in x around inf 77.5%
clear-num77.1%
un-div-inv77.7%
Applied egg-rr77.7%
Final simplification80.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.3e-76) (not (<= y 12200.0))) (* t (/ y (- y z))) (* x (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.3e-76) || !(y <= 12200.0)) {
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.3d-76)) .or. (.not. (y <= 12200.0d0))) 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.3e-76) || !(y <= 12200.0)) {
tmp = t * (y / (y - z));
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.3e-76) or not (y <= 12200.0): 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.3e-76) || !(y <= 12200.0)) 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.3e-76) || ~((y <= 12200.0))) 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.3e-76], N[Not[LessEqual[y, 12200.0]], $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.3 \cdot 10^{-76} \lor \neg \left(y \leq 12200\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -1.3e-76 or 12200 < y Initial program 99.6%
Taylor expanded in x around 0 82.4%
neg-mul-182.4%
distribute-neg-frac282.4%
neg-sub082.4%
sub-neg82.4%
+-commutative82.4%
associate--r+82.4%
neg-sub082.4%
remove-double-neg82.4%
Simplified82.4%
if -1.3e-76 < y < 12200Initial program 93.0%
associate-*l/97.2%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in x around inf 77.5%
Final simplification80.3%
(FPCore (x y z t) :precision binary64 (if (<= y -4.5e+53) t (if (<= y 90000000000000.0) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.5e+53) {
tmp = t;
} else if (y <= 90000000000000.0) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-4.5d+53)) then
tmp = t
else if (y <= 90000000000000.0d0) then
tmp = x * (t / (z - y))
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.5e+53) {
tmp = t;
} else if (y <= 90000000000000.0) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.5e+53: tmp = t elif y <= 90000000000000.0: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.5e+53) tmp = t; elseif (y <= 90000000000000.0) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.5e+53) tmp = t; elseif (y <= 90000000000000.0) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.5e+53], t, If[LessEqual[y, 90000000000000.0], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+53}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 90000000000000:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -4.5000000000000002e53 or 9e13 < y Initial program 99.9%
associate-*l/77.9%
associate-/l*71.2%
Simplified71.2%
Taylor expanded in y around inf 67.2%
if -4.5000000000000002e53 < y < 9e13Initial program 94.2%
associate-*l/94.3%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in x around inf 68.8%
(FPCore (x y z t) :precision binary64 (if (<= y -4.4e-76) t (if (<= y 33000000000000.0) (/ (* x t) z) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.4e-76) {
tmp = t;
} else if (y <= 33000000000000.0) {
tmp = (x * t) / z;
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-4.4d-76)) then
tmp = t
else if (y <= 33000000000000.0d0) then
tmp = (x * t) / z
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.4e-76) {
tmp = t;
} else if (y <= 33000000000000.0) {
tmp = (x * t) / z;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.4e-76: tmp = t elif y <= 33000000000000.0: tmp = (x * t) / z else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.4e-76) tmp = t; elseif (y <= 33000000000000.0) tmp = Float64(Float64(x * t) / z); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.4e-76) tmp = t; elseif (y <= 33000000000000.0) tmp = (x * t) / z; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.4e-76], t, If[LessEqual[y, 33000000000000.0], N[(N[(x * t), $MachinePrecision] / z), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{-76}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 33000000000000:\\
\;\;\;\;\frac{x \cdot t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -4.39999999999999999e-76 or 3.3e13 < y Initial program 99.6%
associate-*l/79.1%
associate-/l*75.4%
Simplified75.4%
Taylor expanded in y around inf 61.1%
if -4.39999999999999999e-76 < y < 3.3e13Initial program 93.2%
associate-*l/96.5%
associate-/l*93.3%
Simplified93.3%
Taylor expanded in y around 0 68.7%
Final simplification64.4%
(FPCore (x y z t) :precision binary64 (if (<= y -4.4e-76) t (if (<= y 2150000000000.0) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.4e-76) {
tmp = t;
} else if (y <= 2150000000000.0) {
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 <= (-4.4d-76)) then
tmp = t
else if (y <= 2150000000000.0d0) 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 <= -4.4e-76) {
tmp = t;
} else if (y <= 2150000000000.0) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.4e-76: tmp = t elif y <= 2150000000000.0: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.4e-76) tmp = t; elseif (y <= 2150000000000.0) 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 <= -4.4e-76) tmp = t; elseif (y <= 2150000000000.0) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.4e-76], t, If[LessEqual[y, 2150000000000.0], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{-76}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2150000000000:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -4.39999999999999999e-76 or 2.15e12 < y Initial program 99.6%
associate-*l/79.1%
associate-/l*75.4%
Simplified75.4%
Taylor expanded in y around inf 61.1%
if -4.39999999999999999e-76 < y < 2.15e12Initial program 93.2%
Taylor expanded in y around 0 66.9%
Final simplification63.6%
(FPCore (x y z t) :precision binary64 (if (<= y -4.4e-76) t (if (<= y 260000000000.0) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.4e-76) {
tmp = t;
} else if (y <= 260000000000.0) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-4.4d-76)) then
tmp = t
else if (y <= 260000000000.0d0) then
tmp = x * (t / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.4e-76) {
tmp = t;
} else if (y <= 260000000000.0) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.4e-76: tmp = t elif y <= 260000000000.0: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.4e-76) tmp = t; elseif (y <= 260000000000.0) tmp = Float64(x * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.4e-76) tmp = t; elseif (y <= 260000000000.0) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.4e-76], t, If[LessEqual[y, 260000000000.0], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{-76}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 260000000000:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -4.39999999999999999e-76 or 2.6e11 < y Initial program 99.6%
associate-*l/79.1%
associate-/l*75.4%
Simplified75.4%
Taylor expanded in y around inf 61.1%
if -4.39999999999999999e-76 < y < 2.6e11Initial program 93.2%
associate-*l/96.5%
associate-/l*93.3%
Simplified93.3%
Taylor expanded in x around inf 76.5%
Taylor expanded in z around inf 66.4%
(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.9%
associate-*l/86.6%
associate-/l*83.2%
Simplified83.2%
Taylor expanded in y around inf 39.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 2024163
(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))