
(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 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x - y) / (z - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x - y) / (z - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
Initial program 97.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- x y) (/ t z))))
(if (<= y -1.05e+74)
t
(if (<= y -145000000000.0)
t_1
(if (<= y 5.5e-66) (* x (/ t (- z y))) (if (<= y 3.4e+45) t_1 t))))))
double code(double x, double y, double z, double t) {
double t_1 = (x - y) * (t / z);
double tmp;
if (y <= -1.05e+74) {
tmp = t;
} else if (y <= -145000000000.0) {
tmp = t_1;
} else if (y <= 5.5e-66) {
tmp = x * (t / (z - y));
} else if (y <= 3.4e+45) {
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 = (x - y) * (t / z)
if (y <= (-1.05d+74)) then
tmp = t
else if (y <= (-145000000000.0d0)) then
tmp = t_1
else if (y <= 5.5d-66) then
tmp = x * (t / (z - y))
else if (y <= 3.4d+45) 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 = (x - y) * (t / z);
double tmp;
if (y <= -1.05e+74) {
tmp = t;
} else if (y <= -145000000000.0) {
tmp = t_1;
} else if (y <= 5.5e-66) {
tmp = x * (t / (z - y));
} else if (y <= 3.4e+45) {
tmp = t_1;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - y) * (t / z) tmp = 0 if y <= -1.05e+74: tmp = t elif y <= -145000000000.0: tmp = t_1 elif y <= 5.5e-66: tmp = x * (t / (z - y)) elif y <= 3.4e+45: tmp = t_1 else: tmp = t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - y) * Float64(t / z)) tmp = 0.0 if (y <= -1.05e+74) tmp = t; elseif (y <= -145000000000.0) tmp = t_1; elseif (y <= 5.5e-66) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 3.4e+45) tmp = t_1; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - y) * (t / z); tmp = 0.0; if (y <= -1.05e+74) tmp = t; elseif (y <= -145000000000.0) tmp = t_1; elseif (y <= 5.5e-66) tmp = x * (t / (z - y)); elseif (y <= 3.4e+45) tmp = t_1; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.05e+74], t, If[LessEqual[y, -145000000000.0], t$95$1, If[LessEqual[y, 5.5e-66], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e+45], t$95$1, t]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{if}\;y \leq -1.05 \cdot 10^{+74}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -145000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-66}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.0499999999999999e74 or 3.4e45 < y Initial program 99.9%
associate-*l/73.1%
associate-/l*66.3%
Simplified66.3%
Taylor expanded in y around inf 67.6%
if -1.0499999999999999e74 < y < -1.45e11 or 5.50000000000000053e-66 < y < 3.4e45Initial program 97.5%
associate-*l/88.9%
associate-/l*92.1%
Simplified92.1%
Taylor expanded in z around inf 72.4%
if -1.45e11 < y < 5.50000000000000053e-66Initial program 94.8%
associate-*l/93.8%
associate-/l*95.5%
Simplified95.5%
Taylor expanded in x around inf 85.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -27500000000.0)
(* t (/ y (- y z)))
(if (<= y 1.15e-66)
(* x (/ t (- z y)))
(if (<= y 9.5e+43) (* (- x y) (/ t z)) (* t (/ (- y x) y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -27500000000.0) {
tmp = t * (y / (y - z));
} else if (y <= 1.15e-66) {
tmp = x * (t / (z - y));
} else if (y <= 9.5e+43) {
tmp = (x - y) * (t / z);
} 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 <= (-27500000000.0d0)) then
tmp = t * (y / (y - z))
else if (y <= 1.15d-66) then
tmp = x * (t / (z - y))
else if (y <= 9.5d+43) then
tmp = (x - y) * (t / z)
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 <= -27500000000.0) {
tmp = t * (y / (y - z));
} else if (y <= 1.15e-66) {
tmp = x * (t / (z - y));
} else if (y <= 9.5e+43) {
tmp = (x - y) * (t / z);
} else {
tmp = t * ((y - x) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -27500000000.0: tmp = t * (y / (y - z)) elif y <= 1.15e-66: tmp = x * (t / (z - y)) elif y <= 9.5e+43: tmp = (x - y) * (t / z) else: tmp = t * ((y - x) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -27500000000.0) tmp = Float64(t * Float64(y / Float64(y - z))); elseif (y <= 1.15e-66) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 9.5e+43) tmp = Float64(Float64(x - y) * Float64(t / z)); else tmp = Float64(t * Float64(Float64(y - x) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -27500000000.0) tmp = t * (y / (y - z)); elseif (y <= 1.15e-66) tmp = x * (t / (z - y)); elseif (y <= 9.5e+43) tmp = (x - y) * (t / z); else tmp = t * ((y - x) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -27500000000.0], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e-66], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e+43], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -27500000000:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-66}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+43}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\end{array}
\end{array}
if y < -2.75e10Initial program 99.8%
Taylor expanded in x around 0 80.9%
neg-mul-180.9%
distribute-neg-frac280.9%
neg-sub080.9%
sub-neg80.9%
+-commutative80.9%
associate--r+80.9%
neg-sub080.9%
remove-double-neg80.9%
Simplified80.9%
if -2.75e10 < y < 1.14999999999999996e-66Initial program 94.8%
associate-*l/93.8%
associate-/l*95.5%
Simplified95.5%
Taylor expanded in x around inf 85.8%
if 1.14999999999999996e-66 < y < 9.5000000000000004e43Initial program 96.2%
associate-*l/92.6%
associate-/l*92.8%
Simplified92.8%
Taylor expanded in z around inf 67.8%
if 9.5000000000000004e43 < y Initial program 99.9%
Taylor expanded in z around 0 84.0%
associate-*r/84.0%
neg-mul-184.0%
neg-sub084.0%
sub-neg84.0%
+-commutative84.0%
associate--r+84.0%
neg-sub084.0%
remove-double-neg84.0%
Simplified84.0%
Final simplification82.2%
(FPCore (x y z t) :precision binary64 (if (<= y -3.5e+160) (- t (* t (/ x y))) (if (<= y 3.15e+103) (* (- x y) (/ t (- z y))) (* t (/ y (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e+160) {
tmp = t - (t * (x / y));
} else if (y <= 3.15e+103) {
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 <= (-3.5d+160)) then
tmp = t - (t * (x / y))
else if (y <= 3.15d+103) 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 <= -3.5e+160) {
tmp = t - (t * (x / y));
} else if (y <= 3.15e+103) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.5e+160: tmp = t - (t * (x / y)) elif y <= 3.15e+103: 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 <= -3.5e+160) tmp = Float64(t - Float64(t * Float64(x / y))); elseif (y <= 3.15e+103) 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 <= -3.5e+160) tmp = t - (t * (x / y)); elseif (y <= 3.15e+103) 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, -3.5e+160], N[(t - N[(t * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.15e+103], 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 -3.5 \cdot 10^{+160}:\\
\;\;\;\;t - t \cdot \frac{x}{y}\\
\mathbf{elif}\;y \leq 3.15 \cdot 10^{+103}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if y < -3.50000000000000026e160Initial program 99.9%
Taylor expanded in z around 0 96.0%
associate-*r/96.0%
neg-mul-196.0%
neg-sub096.0%
sub-neg96.0%
+-commutative96.0%
associate--r+96.0%
neg-sub096.0%
remove-double-neg96.0%
Simplified96.0%
Taylor expanded in y around inf 84.2%
mul-1-neg84.2%
associate-*r/96.1%
unsub-neg96.1%
Simplified96.1%
if -3.50000000000000026e160 < y < 3.14999999999999985e103Initial program 96.3%
associate-*l/91.3%
associate-/l*92.1%
Simplified92.1%
if 3.14999999999999985e103 < y Initial program 99.9%
Taylor expanded in x around 0 83.9%
neg-mul-183.9%
distribute-neg-frac283.9%
neg-sub083.9%
sub-neg83.9%
+-commutative83.9%
associate--r+83.9%
neg-sub083.9%
remove-double-neg83.9%
Simplified83.9%
Final simplification91.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -135000000000.0) (not (<= y 1.55e-46))) (* t (/ y (- y z))) (* x (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -135000000000.0) || !(y <= 1.55e-46)) {
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 <= (-135000000000.0d0)) .or. (.not. (y <= 1.55d-46))) 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 <= -135000000000.0) || !(y <= 1.55e-46)) {
tmp = t * (y / (y - z));
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -135000000000.0) or not (y <= 1.55e-46): tmp = t * (y / (y - z)) else: tmp = x * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -135000000000.0) || !(y <= 1.55e-46)) 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 <= -135000000000.0) || ~((y <= 1.55e-46))) 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, -135000000000.0], N[Not[LessEqual[y, 1.55e-46]], $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 -135000000000 \lor \neg \left(y \leq 1.55 \cdot 10^{-46}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -1.35e11 or 1.55e-46 < y Initial program 99.9%
Taylor expanded in x around 0 75.7%
neg-mul-175.7%
distribute-neg-frac275.7%
neg-sub075.7%
sub-neg75.7%
+-commutative75.7%
associate--r+75.7%
neg-sub075.7%
remove-double-neg75.7%
Simplified75.7%
if -1.35e11 < y < 1.55e-46Initial program 94.1%
associate-*l/94.0%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in x around inf 84.6%
Final simplification79.7%
(FPCore (x y z t) :precision binary64 (if (<= y -8.8e+68) t (if (<= y 1.95e+42) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.8e+68) {
tmp = t;
} else if (y <= 1.95e+42) {
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 <= (-8.8d+68)) then
tmp = t
else if (y <= 1.95d+42) 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 <= -8.8e+68) {
tmp = t;
} else if (y <= 1.95e+42) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.8e+68: tmp = t elif y <= 1.95e+42: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.8e+68) tmp = t; elseif (y <= 1.95e+42) 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 <= -8.8e+68) tmp = t; elseif (y <= 1.95e+42) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.8e+68], t, If[LessEqual[y, 1.95e+42], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.8 \cdot 10^{+68}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{+42}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -8.79999999999999949e68 or 1.94999999999999985e42 < y Initial program 99.9%
associate-*l/73.8%
associate-/l*67.3%
Simplified67.3%
Taylor expanded in y around inf 65.8%
if -8.79999999999999949e68 < y < 1.94999999999999985e42Initial program 95.5%
associate-*l/92.2%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in x around inf 75.5%
(FPCore (x y z t) :precision binary64 (if (<= y -7.8e+68) t (if (<= y 2.7e+41) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.8e+68) {
tmp = t;
} else if (y <= 2.7e+41) {
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.8d+68)) then
tmp = t
else if (y <= 2.7d+41) 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.8e+68) {
tmp = t;
} else if (y <= 2.7e+41) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.8e+68: tmp = t elif y <= 2.7e+41: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.8e+68) tmp = t; elseif (y <= 2.7e+41) 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.8e+68) tmp = t; elseif (y <= 2.7e+41) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.8e+68], t, If[LessEqual[y, 2.7e+41], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{+68}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+41}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.80000000000000037e68 or 2.7e41 < y Initial program 99.9%
associate-*l/73.8%
associate-/l*67.3%
Simplified67.3%
Taylor expanded in y around inf 65.8%
if -7.80000000000000037e68 < y < 2.7e41Initial program 95.5%
Taylor expanded in y around 0 66.2%
Final simplification66.0%
(FPCore (x y z t) :precision binary64 (if (<= y -1.25e+69) t (if (<= y 1.1e+41) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.25e+69) {
tmp = t;
} else if (y <= 1.1e+41) {
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.25d+69)) then
tmp = t
else if (y <= 1.1d+41) 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.25e+69) {
tmp = t;
} else if (y <= 1.1e+41) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.25e+69: tmp = t elif y <= 1.1e+41: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.25e+69) tmp = t; elseif (y <= 1.1e+41) 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.25e+69) tmp = t; elseif (y <= 1.1e+41) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.25e+69], t, If[LessEqual[y, 1.1e+41], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+69}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+41}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.25000000000000009e69 or 1.09999999999999995e41 < y Initial program 99.9%
associate-*l/73.8%
associate-/l*67.3%
Simplified67.3%
Taylor expanded in y around inf 65.8%
if -1.25000000000000009e69 < y < 1.09999999999999995e41Initial program 95.5%
associate-*l/92.2%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in x around inf 75.5%
Taylor expanded in z around inf 64.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 97.3%
associate-*l/84.7%
associate-/l*83.3%
Simplified83.3%
Taylor expanded in y around inf 33.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 2024132
(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))