
(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 15 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 97.5%
*-commutative97.5%
clear-num97.5%
un-div-inv97.5%
Applied egg-rr97.5%
Final simplification97.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -140000.0)
t
(if (<= y -1.9e-43)
(* x (/ t z))
(if (<= y -7e-74)
t
(if (<= y -3e-102)
(* (/ t z) (- y))
(if (<= y 2.55e-38)
(* t (/ x z))
(if (<= y 1.02e+43) (* t (/ (- y) z)) t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -140000.0) {
tmp = t;
} else if (y <= -1.9e-43) {
tmp = x * (t / z);
} else if (y <= -7e-74) {
tmp = t;
} else if (y <= -3e-102) {
tmp = (t / z) * -y;
} else if (y <= 2.55e-38) {
tmp = t * (x / z);
} else if (y <= 1.02e+43) {
tmp = 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 <= (-140000.0d0)) then
tmp = t
else if (y <= (-1.9d-43)) then
tmp = x * (t / z)
else if (y <= (-7d-74)) then
tmp = t
else if (y <= (-3d-102)) then
tmp = (t / z) * -y
else if (y <= 2.55d-38) then
tmp = t * (x / z)
else if (y <= 1.02d+43) then
tmp = 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 <= -140000.0) {
tmp = t;
} else if (y <= -1.9e-43) {
tmp = x * (t / z);
} else if (y <= -7e-74) {
tmp = t;
} else if (y <= -3e-102) {
tmp = (t / z) * -y;
} else if (y <= 2.55e-38) {
tmp = t * (x / z);
} else if (y <= 1.02e+43) {
tmp = t * (-y / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -140000.0: tmp = t elif y <= -1.9e-43: tmp = x * (t / z) elif y <= -7e-74: tmp = t elif y <= -3e-102: tmp = (t / z) * -y elif y <= 2.55e-38: tmp = t * (x / z) elif y <= 1.02e+43: tmp = t * (-y / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -140000.0) tmp = t; elseif (y <= -1.9e-43) tmp = Float64(x * Float64(t / z)); elseif (y <= -7e-74) tmp = t; elseif (y <= -3e-102) tmp = Float64(Float64(t / z) * Float64(-y)); elseif (y <= 2.55e-38) tmp = Float64(t * Float64(x / z)); elseif (y <= 1.02e+43) tmp = Float64(t * Float64(Float64(-y) / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -140000.0) tmp = t; elseif (y <= -1.9e-43) tmp = x * (t / z); elseif (y <= -7e-74) tmp = t; elseif (y <= -3e-102) tmp = (t / z) * -y; elseif (y <= 2.55e-38) tmp = t * (x / z); elseif (y <= 1.02e+43) tmp = t * (-y / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -140000.0], t, If[LessEqual[y, -1.9e-43], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7e-74], t, If[LessEqual[y, -3e-102], N[(N[(t / z), $MachinePrecision] * (-y)), $MachinePrecision], If[LessEqual[y, 2.55e-38], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e+43], N[(t * N[((-y) / z), $MachinePrecision]), $MachinePrecision], t]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -140000:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -1.9 \cdot 10^{-43}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-74}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -3 \cdot 10^{-102}:\\
\;\;\;\;\frac{t}{z} \cdot \left(-y\right)\\
\mathbf{elif}\;y \leq 2.55 \cdot 10^{-38}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{+43}:\\
\;\;\;\;t \cdot \frac{-y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.4e5 or -1.89999999999999985e-43 < y < -7.00000000000000029e-74 or 1.02e43 < y Initial program 99.8%
Taylor expanded in y around inf 68.8%
if -1.4e5 < y < -1.89999999999999985e-43Initial program 100.0%
Taylor expanded in y around 0 75.8%
associate-/l*75.8%
associate-/r/75.8%
Simplified75.8%
if -7.00000000000000029e-74 < y < -3e-102Initial program 99.8%
Taylor expanded in z around inf 47.9%
associate-/l*68.4%
Simplified68.4%
Taylor expanded in x around 0 47.6%
mul-1-neg47.6%
associate-*l/55.1%
*-commutative55.1%
distribute-rgt-neg-in55.1%
Simplified55.1%
if -3e-102 < y < 2.55000000000000014e-38Initial program 94.4%
Taylor expanded in y around 0 69.6%
if 2.55000000000000014e-38 < y < 1.02e43Initial program 99.7%
Taylor expanded in x around 0 59.6%
neg-mul-159.6%
distribute-neg-frac59.6%
Simplified59.6%
Taylor expanded in y around 0 60.2%
associate-*r/60.2%
neg-mul-160.2%
Simplified60.2%
Final simplification68.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.2e+99)
t
(if (<= y -4.5e-48)
(/ (- t) (/ y x))
(if (<= y -1.45e-78)
t
(if (<= y -3e-102)
(* (/ t z) (- y))
(if (<= y 2.35e-39)
(* t (/ x z))
(if (<= y 2.9e+63) (* t (/ (- y) z)) t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.2e+99) {
tmp = t;
} else if (y <= -4.5e-48) {
tmp = -t / (y / x);
} else if (y <= -1.45e-78) {
tmp = t;
} else if (y <= -3e-102) {
tmp = (t / z) * -y;
} else if (y <= 2.35e-39) {
tmp = t * (x / z);
} else if (y <= 2.9e+63) {
tmp = 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.2d+99)) then
tmp = t
else if (y <= (-4.5d-48)) then
tmp = -t / (y / x)
else if (y <= (-1.45d-78)) then
tmp = t
else if (y <= (-3d-102)) then
tmp = (t / z) * -y
else if (y <= 2.35d-39) then
tmp = t * (x / z)
else if (y <= 2.9d+63) then
tmp = 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.2e+99) {
tmp = t;
} else if (y <= -4.5e-48) {
tmp = -t / (y / x);
} else if (y <= -1.45e-78) {
tmp = t;
} else if (y <= -3e-102) {
tmp = (t / z) * -y;
} else if (y <= 2.35e-39) {
tmp = t * (x / z);
} else if (y <= 2.9e+63) {
tmp = t * (-y / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.2e+99: tmp = t elif y <= -4.5e-48: tmp = -t / (y / x) elif y <= -1.45e-78: tmp = t elif y <= -3e-102: tmp = (t / z) * -y elif y <= 2.35e-39: tmp = t * (x / z) elif y <= 2.9e+63: tmp = t * (-y / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.2e+99) tmp = t; elseif (y <= -4.5e-48) tmp = Float64(Float64(-t) / Float64(y / x)); elseif (y <= -1.45e-78) tmp = t; elseif (y <= -3e-102) tmp = Float64(Float64(t / z) * Float64(-y)); elseif (y <= 2.35e-39) tmp = Float64(t * Float64(x / z)); elseif (y <= 2.9e+63) tmp = Float64(t * Float64(Float64(-y) / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.2e+99) tmp = t; elseif (y <= -4.5e-48) tmp = -t / (y / x); elseif (y <= -1.45e-78) tmp = t; elseif (y <= -3e-102) tmp = (t / z) * -y; elseif (y <= 2.35e-39) tmp = t * (x / z); elseif (y <= 2.9e+63) tmp = t * (-y / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.2e+99], t, If[LessEqual[y, -4.5e-48], N[((-t) / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.45e-78], t, If[LessEqual[y, -3e-102], N[(N[(t / z), $MachinePrecision] * (-y)), $MachinePrecision], If[LessEqual[y, 2.35e-39], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e+63], N[(t * N[((-y) / z), $MachinePrecision]), $MachinePrecision], t]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{+99}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{-48}:\\
\;\;\;\;\frac{-t}{\frac{y}{x}}\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{-78}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -3 \cdot 10^{-102}:\\
\;\;\;\;\frac{t}{z} \cdot \left(-y\right)\\
\mathbf{elif}\;y \leq 2.35 \cdot 10^{-39}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+63}:\\
\;\;\;\;t \cdot \frac{-y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.19999999999999999e99 or -4.49999999999999988e-48 < y < -1.45e-78 or 2.8999999999999999e63 < y Initial program 99.9%
Taylor expanded in y around inf 74.6%
if -3.19999999999999999e99 < y < -4.49999999999999988e-48Initial program 99.8%
Taylor expanded in x around inf 56.8%
*-commutative56.8%
associate-*r/60.5%
Simplified60.5%
Taylor expanded in z around 0 49.0%
mul-1-neg49.0%
associate-/l*49.9%
distribute-neg-frac49.9%
Simplified49.9%
if -1.45e-78 < y < -3e-102Initial program 99.8%
Taylor expanded in z around inf 47.9%
associate-/l*68.4%
Simplified68.4%
Taylor expanded in x around 0 47.6%
mul-1-neg47.6%
associate-*l/55.1%
*-commutative55.1%
distribute-rgt-neg-in55.1%
Simplified55.1%
if -3e-102 < y < 2.3500000000000001e-39Initial program 94.4%
Taylor expanded in y around 0 69.6%
if 2.3500000000000001e-39 < y < 2.8999999999999999e63Initial program 99.7%
Taylor expanded in x around 0 59.6%
neg-mul-159.6%
distribute-neg-frac59.6%
Simplified59.6%
Taylor expanded in y around 0 60.2%
associate-*r/60.2%
neg-mul-160.2%
Simplified60.2%
Final simplification68.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -75000.0)
t
(if (<= y -1.8e-43)
(* x (/ t z))
(if (<= y -3.6e-74)
t
(if (<= y -1.05e-102)
(* (/ t z) (- y))
(if (<= y 4e+47) (* t (/ x z)) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -75000.0) {
tmp = t;
} else if (y <= -1.8e-43) {
tmp = x * (t / z);
} else if (y <= -3.6e-74) {
tmp = t;
} else if (y <= -1.05e-102) {
tmp = (t / z) * -y;
} else if (y <= 4e+47) {
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 <= (-75000.0d0)) then
tmp = t
else if (y <= (-1.8d-43)) then
tmp = x * (t / z)
else if (y <= (-3.6d-74)) then
tmp = t
else if (y <= (-1.05d-102)) then
tmp = (t / z) * -y
else if (y <= 4d+47) 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 <= -75000.0) {
tmp = t;
} else if (y <= -1.8e-43) {
tmp = x * (t / z);
} else if (y <= -3.6e-74) {
tmp = t;
} else if (y <= -1.05e-102) {
tmp = (t / z) * -y;
} else if (y <= 4e+47) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -75000.0: tmp = t elif y <= -1.8e-43: tmp = x * (t / z) elif y <= -3.6e-74: tmp = t elif y <= -1.05e-102: tmp = (t / z) * -y elif y <= 4e+47: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -75000.0) tmp = t; elseif (y <= -1.8e-43) tmp = Float64(x * Float64(t / z)); elseif (y <= -3.6e-74) tmp = t; elseif (y <= -1.05e-102) tmp = Float64(Float64(t / z) * Float64(-y)); elseif (y <= 4e+47) 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 <= -75000.0) tmp = t; elseif (y <= -1.8e-43) tmp = x * (t / z); elseif (y <= -3.6e-74) tmp = t; elseif (y <= -1.05e-102) tmp = (t / z) * -y; elseif (y <= 4e+47) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -75000.0], t, If[LessEqual[y, -1.8e-43], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.6e-74], t, If[LessEqual[y, -1.05e-102], N[(N[(t / z), $MachinePrecision] * (-y)), $MachinePrecision], If[LessEqual[y, 4e+47], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -75000:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-43}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq -3.6 \cdot 10^{-74}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-102}:\\
\;\;\;\;\frac{t}{z} \cdot \left(-y\right)\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+47}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -75000 or -1.7999999999999999e-43 < y < -3.6000000000000002e-74 or 4.0000000000000002e47 < y Initial program 99.8%
Taylor expanded in y around inf 68.8%
if -75000 < y < -1.7999999999999999e-43Initial program 100.0%
Taylor expanded in y around 0 75.8%
associate-/l*75.8%
associate-/r/75.8%
Simplified75.8%
if -3.6000000000000002e-74 < y < -1.05e-102Initial program 99.8%
Taylor expanded in z around inf 47.9%
associate-/l*68.4%
Simplified68.4%
Taylor expanded in x around 0 47.6%
mul-1-neg47.6%
associate-*l/55.1%
*-commutative55.1%
distribute-rgt-neg-in55.1%
Simplified55.1%
if -1.05e-102 < y < 4.0000000000000002e47Initial program 94.9%
Taylor expanded in y around 0 64.8%
Final simplification66.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ t (/ z (- x y)))) (t_2 (* t (- 1.0 (/ x y)))))
(if (<= y -2e-72)
t_2
(if (<= y 1.25e-229)
t_1
(if (<= y 1.9e-40) (* x (/ t (- z y))) (if (<= y 3.7e+58) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = t / (z / (x - y));
double t_2 = t * (1.0 - (x / y));
double tmp;
if (y <= -2e-72) {
tmp = t_2;
} else if (y <= 1.25e-229) {
tmp = t_1;
} else if (y <= 1.9e-40) {
tmp = x * (t / (z - y));
} else if (y <= 3.7e+58) {
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 = t / (z / (x - y))
t_2 = t * (1.0d0 - (x / y))
if (y <= (-2d-72)) then
tmp = t_2
else if (y <= 1.25d-229) then
tmp = t_1
else if (y <= 1.9d-40) then
tmp = x * (t / (z - y))
else if (y <= 3.7d+58) 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 = t / (z / (x - y));
double t_2 = t * (1.0 - (x / y));
double tmp;
if (y <= -2e-72) {
tmp = t_2;
} else if (y <= 1.25e-229) {
tmp = t_1;
} else if (y <= 1.9e-40) {
tmp = x * (t / (z - y));
} else if (y <= 3.7e+58) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = t / (z / (x - y)) t_2 = t * (1.0 - (x / y)) tmp = 0 if y <= -2e-72: tmp = t_2 elif y <= 1.25e-229: tmp = t_1 elif y <= 1.9e-40: tmp = x * (t / (z - y)) elif y <= 3.7e+58: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(t / Float64(z / Float64(x - y))) t_2 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (y <= -2e-72) tmp = t_2; elseif (y <= 1.25e-229) tmp = t_1; elseif (y <= 1.9e-40) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 3.7e+58) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t / (z / (x - y)); t_2 = t * (1.0 - (x / y)); tmp = 0.0; if (y <= -2e-72) tmp = t_2; elseif (y <= 1.25e-229) tmp = t_1; elseif (y <= 1.9e-40) tmp = x * (t / (z - y)); elseif (y <= 3.7e+58) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t / N[(z / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e-72], t$95$2, If[LessEqual[y, 1.25e-229], t$95$1, If[LessEqual[y, 1.9e-40], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.7e+58], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{\frac{z}{x - y}}\\
t_2 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -2 \cdot 10^{-72}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-229}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-40}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -1.9999999999999999e-72 or 3.7000000000000002e58 < y Initial program 99.9%
Taylor expanded in z around 0 80.9%
associate-*r/80.9%
neg-mul-180.9%
Simplified80.9%
Taylor expanded in x around 0 80.9%
mul-1-neg80.9%
unsub-neg80.9%
Simplified80.9%
if -1.9999999999999999e-72 < y < 1.25000000000000004e-229 or 1.8999999999999999e-40 < y < 3.7000000000000002e58Initial program 96.1%
Taylor expanded in z around inf 75.8%
associate-/l*80.7%
Simplified80.7%
if 1.25000000000000004e-229 < y < 1.8999999999999999e-40Initial program 93.5%
Taylor expanded in x around inf 75.7%
*-commutative75.7%
associate-*r/84.4%
Simplified84.4%
Final simplification81.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -8.3e-69)
(* t (- 1.0 (/ x y)))
(if (<= y 7.8e-230)
(/ t (/ z (- x y)))
(if (<= y 9e-42) (* x (/ t (- z y))) (/ t (/ (- y z) y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.3e-69) {
tmp = t * (1.0 - (x / y));
} else if (y <= 7.8e-230) {
tmp = t / (z / (x - y));
} else if (y <= 9e-42) {
tmp = x * (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 <= (-8.3d-69)) then
tmp = t * (1.0d0 - (x / y))
else if (y <= 7.8d-230) then
tmp = t / (z / (x - y))
else if (y <= 9d-42) then
tmp = x * (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 <= -8.3e-69) {
tmp = t * (1.0 - (x / y));
} else if (y <= 7.8e-230) {
tmp = t / (z / (x - y));
} else if (y <= 9e-42) {
tmp = x * (t / (z - y));
} else {
tmp = t / ((y - z) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.3e-69: tmp = t * (1.0 - (x / y)) elif y <= 7.8e-230: tmp = t / (z / (x - y)) elif y <= 9e-42: tmp = x * (t / (z - y)) else: tmp = t / ((y - z) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.3e-69) tmp = Float64(t * Float64(1.0 - Float64(x / y))); elseif (y <= 7.8e-230) tmp = Float64(t / Float64(z / Float64(x - y))); elseif (y <= 9e-42) tmp = Float64(x * 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 <= -8.3e-69) tmp = t * (1.0 - (x / y)); elseif (y <= 7.8e-230) tmp = t / (z / (x - y)); elseif (y <= 9e-42) tmp = x * (t / (z - y)); else tmp = t / ((y - z) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.3e-69], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e-230], N[(t / N[(z / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e-42], N[(x * 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 -8.3 \cdot 10^{-69}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{-230}:\\
\;\;\;\;\frac{t}{\frac{z}{x - y}}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-42}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{y - z}{y}}\\
\end{array}
\end{array}
if y < -8.3000000000000004e-69Initial program 99.9%
Taylor expanded in z around 0 84.5%
associate-*r/84.5%
neg-mul-184.5%
Simplified84.5%
Taylor expanded in x around 0 84.5%
mul-1-neg84.5%
unsub-neg84.5%
Simplified84.5%
if -8.3000000000000004e-69 < y < 7.8000000000000004e-230Initial program 95.5%
Taylor expanded in z around inf 75.5%
associate-/l*81.3%
Simplified81.3%
if 7.8000000000000004e-230 < y < 9e-42Initial program 93.3%
Taylor expanded in x around inf 77.4%
*-commutative77.4%
associate-*r/86.2%
Simplified86.2%
if 9e-42 < y Initial program 99.9%
Taylor expanded in x around 0 88.2%
neg-mul-188.2%
distribute-neg-frac88.2%
Simplified88.2%
*-commutative88.2%
frac-2neg88.2%
remove-double-neg88.2%
associate-*r/70.9%
sub-neg70.9%
distribute-neg-in70.9%
remove-double-neg70.9%
Applied egg-rr70.9%
associate-/l*88.2%
+-commutative88.2%
unsub-neg88.2%
Simplified88.2%
Final simplification84.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.4e-69) (not (<= y 3.55e-43))) (* t (- 1.0 (/ x y))) (* x (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.4e-69) || !(y <= 3.55e-43)) {
tmp = t * (1.0 - (x / y));
} 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.4d-69)) .or. (.not. (y <= 3.55d-43))) then
tmp = t * (1.0d0 - (x / y))
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.4e-69) || !(y <= 3.55e-43)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.4e-69) or not (y <= 3.55e-43): tmp = t * (1.0 - (x / y)) else: tmp = x * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.4e-69) || !(y <= 3.55e-43)) tmp = Float64(t * Float64(1.0 - Float64(x / y))); 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 <= -4.4e-69) || ~((y <= 3.55e-43))) tmp = t * (1.0 - (x / y)); else tmp = x * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.4e-69], N[Not[LessEqual[y, 3.55e-43]], $MachinePrecision]], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{-69} \lor \neg \left(y \leq 3.55 \cdot 10^{-43}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -4.4e-69 or 3.55000000000000013e-43 < y Initial program 99.9%
Taylor expanded in z around 0 76.2%
associate-*r/76.2%
neg-mul-176.2%
Simplified76.2%
Taylor expanded in x around 0 76.2%
mul-1-neg76.2%
unsub-neg76.2%
Simplified76.2%
if -4.4e-69 < y < 3.55000000000000013e-43Initial program 94.6%
Taylor expanded in x around inf 77.3%
*-commutative77.3%
associate-*r/79.0%
Simplified79.0%
Final simplification77.5%
(FPCore (x y z t) :precision binary64 (if (<= y -3.2e+99) t (if (<= y 2e+49) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.2e+99) {
tmp = t;
} else if (y <= 2e+49) {
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 <= (-3.2d+99)) then
tmp = t
else if (y <= 2d+49) 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 <= -3.2e+99) {
tmp = t;
} else if (y <= 2e+49) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.2e+99: tmp = t elif y <= 2e+49: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.2e+99) tmp = t; elseif (y <= 2e+49) 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 <= -3.2e+99) tmp = t; elseif (y <= 2e+49) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.2e+99], t, If[LessEqual[y, 2e+49], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{+99}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+49}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.19999999999999999e99 or 1.99999999999999989e49 < y Initial program 99.9%
Taylor expanded in y around inf 75.9%
if -3.19999999999999999e99 < y < 1.99999999999999989e49Initial program 96.1%
Taylor expanded in x around inf 69.6%
*-commutative69.6%
associate-*r/70.3%
Simplified70.3%
Final simplification72.4%
(FPCore (x y z t) :precision binary64 (if (<= y -1.04e-70) (* t (- 1.0 (/ x y))) (if (<= y 8.6) (/ t (/ (- z y) x)) (/ t (/ (- y z) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.04e-70) {
tmp = t * (1.0 - (x / y));
} else if (y <= 8.6) {
tmp = t / ((z - y) / x);
} 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 <= (-1.04d-70)) then
tmp = t * (1.0d0 - (x / y))
else if (y <= 8.6d0) then
tmp = t / ((z - y) / x)
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 <= -1.04e-70) {
tmp = t * (1.0 - (x / y));
} else if (y <= 8.6) {
tmp = t / ((z - y) / x);
} else {
tmp = t / ((y - z) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.04e-70: tmp = t * (1.0 - (x / y)) elif y <= 8.6: tmp = t / ((z - y) / x) else: tmp = t / ((y - z) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.04e-70) tmp = Float64(t * Float64(1.0 - Float64(x / y))); elseif (y <= 8.6) tmp = Float64(t / Float64(Float64(z - y) / x)); 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 <= -1.04e-70) tmp = t * (1.0 - (x / y)); elseif (y <= 8.6) tmp = t / ((z - y) / x); else tmp = t / ((y - z) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.04e-70], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.6], N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t / N[(N[(y - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.04 \cdot 10^{-70}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{elif}\;y \leq 8.6:\\
\;\;\;\;\frac{t}{\frac{z - y}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{y - z}{y}}\\
\end{array}
\end{array}
if y < -1.0399999999999999e-70Initial program 99.9%
Taylor expanded in z around 0 84.5%
associate-*r/84.5%
neg-mul-184.5%
Simplified84.5%
Taylor expanded in x around 0 84.5%
mul-1-neg84.5%
unsub-neg84.5%
Simplified84.5%
if -1.0399999999999999e-70 < y < 8.59999999999999964Initial program 95.0%
*-commutative95.0%
clear-num94.9%
un-div-inv95.0%
Applied egg-rr95.0%
Taylor expanded in x around inf 75.9%
associate-/l*79.8%
Simplified79.8%
if 8.59999999999999964 < y Initial program 99.9%
Taylor expanded in x around 0 93.2%
neg-mul-193.2%
distribute-neg-frac93.2%
Simplified93.2%
*-commutative93.2%
frac-2neg93.2%
remove-double-neg93.2%
associate-*r/73.8%
sub-neg73.8%
distribute-neg-in73.8%
remove-double-neg73.8%
Applied egg-rr73.8%
associate-/l*93.2%
+-commutative93.2%
unsub-neg93.2%
Simplified93.2%
Final simplification84.2%
(FPCore (x y z t) :precision binary64 (if (<= y -8.2e-122) t (if (<= y 2.15e-72) (* y (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.2e-122) {
tmp = t;
} else if (y <= 2.15e-72) {
tmp = y * (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 <= (-8.2d-122)) then
tmp = t
else if (y <= 2.15d-72) then
tmp = y * (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 <= -8.2e-122) {
tmp = t;
} else if (y <= 2.15e-72) {
tmp = y * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.2e-122: tmp = t elif y <= 2.15e-72: tmp = y * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.2e-122) tmp = t; elseif (y <= 2.15e-72) tmp = Float64(y * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8.2e-122) tmp = t; elseif (y <= 2.15e-72) tmp = y * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.2e-122], t, If[LessEqual[y, 2.15e-72], N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{-122}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{-72}:\\
\;\;\;\;y \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -8.2000000000000001e-122 or 2.1499999999999999e-72 < y Initial program 99.8%
Taylor expanded in y around inf 55.2%
if -8.2000000000000001e-122 < y < 2.1499999999999999e-72Initial program 93.4%
Taylor expanded in z around inf 75.3%
associate-/l*77.3%
Simplified77.3%
Taylor expanded in x around 0 26.1%
mul-1-neg26.1%
associate-*l/27.0%
*-commutative27.0%
distribute-rgt-neg-in27.0%
Simplified27.0%
expm1-log1p-u23.3%
expm1-udef21.6%
add-sqr-sqrt18.8%
sqrt-unprod22.8%
sqr-neg22.8%
sqrt-unprod11.8%
add-sqr-sqrt22.7%
Applied egg-rr22.7%
expm1-def22.8%
expm1-log1p24.1%
Simplified24.1%
Final simplification44.2%
(FPCore (x y z t) :precision binary64 (if (<= y -65000.0) t (if (<= y 7.8e-43) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -65000.0) {
tmp = t;
} else if (y <= 7.8e-43) {
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 <= (-65000.0d0)) then
tmp = t
else if (y <= 7.8d-43) 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 <= -65000.0) {
tmp = t;
} else if (y <= 7.8e-43) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -65000.0: tmp = t elif y <= 7.8e-43: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -65000.0) tmp = t; elseif (y <= 7.8e-43) 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 <= -65000.0) tmp = t; elseif (y <= 7.8e-43) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -65000.0], t, If[LessEqual[y, 7.8e-43], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -65000:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{-43}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -65000 or 7.80000000000000001e-43 < y Initial program 99.9%
Taylor expanded in y around inf 64.2%
if -65000 < y < 7.80000000000000001e-43Initial program 95.2%
Taylor expanded in y around 0 60.4%
associate-/l*65.4%
associate-/r/62.3%
Simplified62.3%
Final simplification63.2%
(FPCore (x y z t) :precision binary64 (if (<= y -140000.0) t (if (<= y 3.5e+58) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -140000.0) {
tmp = t;
} else if (y <= 3.5e+58) {
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 <= (-140000.0d0)) then
tmp = t
else if (y <= 3.5d+58) 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 <= -140000.0) {
tmp = t;
} else if (y <= 3.5e+58) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -140000.0: tmp = t elif y <= 3.5e+58: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -140000.0) tmp = t; elseif (y <= 3.5e+58) 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 <= -140000.0) tmp = t; elseif (y <= 3.5e+58) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -140000.0], t, If[LessEqual[y, 3.5e+58], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -140000:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+58}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.4e5 or 3.4999999999999997e58 < y Initial program 99.9%
Taylor expanded in y around inf 71.1%
if -1.4e5 < y < 3.4999999999999997e58Initial program 95.7%
Taylor expanded in y around 0 60.6%
Final simplification65.2%
(FPCore (x y z t) :precision binary64 (if (<= y -42000.0) t (if (<= y 8.6e+38) (/ t (/ z x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -42000.0) {
tmp = t;
} else if (y <= 8.6e+38) {
tmp = t / (z / x);
} 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 <= (-42000.0d0)) then
tmp = t
else if (y <= 8.6d+38) then
tmp = t / (z / x)
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 <= -42000.0) {
tmp = t;
} else if (y <= 8.6e+38) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -42000.0: tmp = t elif y <= 8.6e+38: tmp = t / (z / x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -42000.0) tmp = t; elseif (y <= 8.6e+38) tmp = Float64(t / Float64(z / x)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -42000.0) tmp = t; elseif (y <= 8.6e+38) tmp = t / (z / x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -42000.0], t, If[LessEqual[y, 8.6e+38], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -42000:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{+38}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -42000 or 8.5999999999999994e38 < y Initial program 99.9%
Taylor expanded in y around inf 71.1%
if -42000 < y < 8.5999999999999994e38Initial program 95.7%
Taylor expanded in y around 0 56.2%
associate-/l*60.6%
Simplified60.6%
Final simplification65.2%
(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 97.5%
Final simplification97.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 97.5%
Taylor expanded in y around inf 38.0%
Final simplification38.0%
(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 2024040
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(/ t (/ (- z y) (- x y)))
(* (/ (- x y) (- z y)) t))