
(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 98.0%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- 1.0 (/ x y)))) (t_2 (* t (/ (- y) (- z y)))))
(if (<= y -8.5e+38)
t_2
(if (<= y -8.4e-16)
t_1
(if (<= y -1.42e-61)
(/ t (/ z (- x y)))
(if (<= y -2.1e-117)
(* (- x y) (/ t z))
(if (<= y -4.2e-211)
(* x (/ t (- z y)))
(if (<= y 9.8e-83)
(* t (/ (- x y) z))
(if (<= y 2.9e-5)
(* t (/ x (- z y)))
(if (<= y 2.5e+150) t_1 t_2))))))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double t_2 = t * (-y / (z - y));
double tmp;
if (y <= -8.5e+38) {
tmp = t_2;
} else if (y <= -8.4e-16) {
tmp = t_1;
} else if (y <= -1.42e-61) {
tmp = t / (z / (x - y));
} else if (y <= -2.1e-117) {
tmp = (x - y) * (t / z);
} else if (y <= -4.2e-211) {
tmp = x * (t / (z - y));
} else if (y <= 9.8e-83) {
tmp = t * ((x - y) / z);
} else if (y <= 2.9e-5) {
tmp = t * (x / (z - y));
} else if (y <= 2.5e+150) {
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 * (1.0d0 - (x / y))
t_2 = t * (-y / (z - y))
if (y <= (-8.5d+38)) then
tmp = t_2
else if (y <= (-8.4d-16)) then
tmp = t_1
else if (y <= (-1.42d-61)) then
tmp = t / (z / (x - y))
else if (y <= (-2.1d-117)) then
tmp = (x - y) * (t / z)
else if (y <= (-4.2d-211)) then
tmp = x * (t / (z - y))
else if (y <= 9.8d-83) then
tmp = t * ((x - y) / z)
else if (y <= 2.9d-5) then
tmp = t * (x / (z - y))
else if (y <= 2.5d+150) 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 * (1.0 - (x / y));
double t_2 = t * (-y / (z - y));
double tmp;
if (y <= -8.5e+38) {
tmp = t_2;
} else if (y <= -8.4e-16) {
tmp = t_1;
} else if (y <= -1.42e-61) {
tmp = t / (z / (x - y));
} else if (y <= -2.1e-117) {
tmp = (x - y) * (t / z);
} else if (y <= -4.2e-211) {
tmp = x * (t / (z - y));
} else if (y <= 9.8e-83) {
tmp = t * ((x - y) / z);
} else if (y <= 2.9e-5) {
tmp = t * (x / (z - y));
} else if (y <= 2.5e+150) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (1.0 - (x / y)) t_2 = t * (-y / (z - y)) tmp = 0 if y <= -8.5e+38: tmp = t_2 elif y <= -8.4e-16: tmp = t_1 elif y <= -1.42e-61: tmp = t / (z / (x - y)) elif y <= -2.1e-117: tmp = (x - y) * (t / z) elif y <= -4.2e-211: tmp = x * (t / (z - y)) elif y <= 9.8e-83: tmp = t * ((x - y) / z) elif y <= 2.9e-5: tmp = t * (x / (z - y)) elif y <= 2.5e+150: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(1.0 - Float64(x / y))) t_2 = Float64(t * Float64(Float64(-y) / Float64(z - y))) tmp = 0.0 if (y <= -8.5e+38) tmp = t_2; elseif (y <= -8.4e-16) tmp = t_1; elseif (y <= -1.42e-61) tmp = Float64(t / Float64(z / Float64(x - y))); elseif (y <= -2.1e-117) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (y <= -4.2e-211) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 9.8e-83) tmp = Float64(t * Float64(Float64(x - y) / z)); elseif (y <= 2.9e-5) tmp = Float64(t * Float64(x / Float64(z - y))); elseif (y <= 2.5e+150) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (1.0 - (x / y)); t_2 = t * (-y / (z - y)); tmp = 0.0; if (y <= -8.5e+38) tmp = t_2; elseif (y <= -8.4e-16) tmp = t_1; elseif (y <= -1.42e-61) tmp = t / (z / (x - y)); elseif (y <= -2.1e-117) tmp = (x - y) * (t / z); elseif (y <= -4.2e-211) tmp = x * (t / (z - y)); elseif (y <= 9.8e-83) tmp = t * ((x - y) / z); elseif (y <= 2.9e-5) tmp = t * (x / (z - y)); elseif (y <= 2.5e+150) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[((-y) / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.5e+38], t$95$2, If[LessEqual[y, -8.4e-16], t$95$1, If[LessEqual[y, -1.42e-61], N[(t / N[(z / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.1e-117], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.2e-211], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.8e-83], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e-5], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e+150], t$95$1, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
t_2 := t \cdot \frac{-y}{z - y}\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{+38}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -8.4 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.42 \cdot 10^{-61}:\\
\;\;\;\;\frac{t}{\frac{z}{x - y}}\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-117}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-211}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{-83}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-5}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+150}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -8.4999999999999997e38 or 2.50000000000000004e150 < y Initial program 99.9%
Taylor expanded in x around 0 90.7%
neg-mul-190.7%
distribute-neg-frac90.7%
Simplified90.7%
if -8.4999999999999997e38 < y < -8.4000000000000004e-16 or 2.9e-5 < y < 2.50000000000000004e150Initial program 99.9%
Taylor expanded in z around 0 78.6%
mul-1-neg78.6%
div-sub78.6%
sub-neg78.6%
*-inverses78.6%
metadata-eval78.6%
Simplified78.6%
Taylor expanded in x around 0 78.6%
associate-*r/78.6%
*-commutative78.6%
neg-mul-178.6%
distribute-lft-neg-out78.6%
associate-*l/78.6%
*-lft-identity78.6%
distribute-rgt-in78.6%
distribute-frac-neg78.6%
sub-neg78.6%
Simplified78.6%
if -8.4000000000000004e-16 < y < -1.42e-61Initial program 99.7%
Taylor expanded in z around inf 83.8%
associate-/l*83.8%
Simplified83.8%
if -1.42e-61 < y < -2.0999999999999999e-117Initial program 88.0%
Taylor expanded in z around inf 69.1%
associate-/l*57.2%
associate-/r/69.2%
Simplified69.2%
if -2.0999999999999999e-117 < y < -4.20000000000000015e-211Initial program 99.6%
Taylor expanded in x around inf 93.2%
*-commutative93.2%
associate-*r/93.0%
Simplified93.0%
if -4.20000000000000015e-211 < y < 9.8e-83Initial program 97.2%
Taylor expanded in z around inf 89.1%
if 9.8e-83 < y < 2.9e-5Initial program 93.2%
Taylor expanded in x around inf 82.5%
Final simplification86.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- 1.0 (/ x y)))))
(if (<= y -1.9e+42)
(* t (/ (- y) (- z y)))
(if (<= y -1.55e-13)
t_1
(if (<= y -2.6e-61)
(/ t (/ z (- x y)))
(if (<= y -7.5e-124)
(* (- x y) (/ t z))
(if (<= y -3.5e-211)
(* x (/ t (- z y)))
(if (<= y 4.7e-82)
(* t (/ (- x y) z))
(if (<= y 0.02)
(* t (/ x (- z y)))
(if (<= y 2.45e+150) t_1 (/ (- t) (+ (/ z y) -1.0))))))))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (y <= -1.9e+42) {
tmp = t * (-y / (z - y));
} else if (y <= -1.55e-13) {
tmp = t_1;
} else if (y <= -2.6e-61) {
tmp = t / (z / (x - y));
} else if (y <= -7.5e-124) {
tmp = (x - y) * (t / z);
} else if (y <= -3.5e-211) {
tmp = x * (t / (z - y));
} else if (y <= 4.7e-82) {
tmp = t * ((x - y) / z);
} else if (y <= 0.02) {
tmp = t * (x / (z - y));
} else if (y <= 2.45e+150) {
tmp = t_1;
} else {
tmp = -t / ((z / y) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = t * (1.0d0 - (x / y))
if (y <= (-1.9d+42)) then
tmp = t * (-y / (z - y))
else if (y <= (-1.55d-13)) then
tmp = t_1
else if (y <= (-2.6d-61)) then
tmp = t / (z / (x - y))
else if (y <= (-7.5d-124)) then
tmp = (x - y) * (t / z)
else if (y <= (-3.5d-211)) then
tmp = x * (t / (z - y))
else if (y <= 4.7d-82) then
tmp = t * ((x - y) / z)
else if (y <= 0.02d0) then
tmp = t * (x / (z - y))
else if (y <= 2.45d+150) then
tmp = t_1
else
tmp = -t / ((z / y) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (y <= -1.9e+42) {
tmp = t * (-y / (z - y));
} else if (y <= -1.55e-13) {
tmp = t_1;
} else if (y <= -2.6e-61) {
tmp = t / (z / (x - y));
} else if (y <= -7.5e-124) {
tmp = (x - y) * (t / z);
} else if (y <= -3.5e-211) {
tmp = x * (t / (z - y));
} else if (y <= 4.7e-82) {
tmp = t * ((x - y) / z);
} else if (y <= 0.02) {
tmp = t * (x / (z - y));
} else if (y <= 2.45e+150) {
tmp = t_1;
} else {
tmp = -t / ((z / y) + -1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (1.0 - (x / y)) tmp = 0 if y <= -1.9e+42: tmp = t * (-y / (z - y)) elif y <= -1.55e-13: tmp = t_1 elif y <= -2.6e-61: tmp = t / (z / (x - y)) elif y <= -7.5e-124: tmp = (x - y) * (t / z) elif y <= -3.5e-211: tmp = x * (t / (z - y)) elif y <= 4.7e-82: tmp = t * ((x - y) / z) elif y <= 0.02: tmp = t * (x / (z - y)) elif y <= 2.45e+150: tmp = t_1 else: tmp = -t / ((z / y) + -1.0) return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (y <= -1.9e+42) tmp = Float64(t * Float64(Float64(-y) / Float64(z - y))); elseif (y <= -1.55e-13) tmp = t_1; elseif (y <= -2.6e-61) tmp = Float64(t / Float64(z / Float64(x - y))); elseif (y <= -7.5e-124) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (y <= -3.5e-211) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 4.7e-82) tmp = Float64(t * Float64(Float64(x - y) / z)); elseif (y <= 0.02) tmp = Float64(t * Float64(x / Float64(z - y))); elseif (y <= 2.45e+150) tmp = t_1; else tmp = Float64(Float64(-t) / Float64(Float64(z / y) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (1.0 - (x / y)); tmp = 0.0; if (y <= -1.9e+42) tmp = t * (-y / (z - y)); elseif (y <= -1.55e-13) tmp = t_1; elseif (y <= -2.6e-61) tmp = t / (z / (x - y)); elseif (y <= -7.5e-124) tmp = (x - y) * (t / z); elseif (y <= -3.5e-211) tmp = x * (t / (z - y)); elseif (y <= 4.7e-82) tmp = t * ((x - y) / z); elseif (y <= 0.02) tmp = t * (x / (z - y)); elseif (y <= 2.45e+150) tmp = t_1; else tmp = -t / ((z / y) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.9e+42], N[(t * N[((-y) / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.55e-13], t$95$1, If[LessEqual[y, -2.6e-61], N[(t / N[(z / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.5e-124], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.5e-211], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.7e-82], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.02], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.45e+150], t$95$1, N[((-t) / N[(N[(z / y), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{+42}:\\
\;\;\;\;t \cdot \frac{-y}{z - y}\\
\mathbf{elif}\;y \leq -1.55 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.6 \cdot 10^{-61}:\\
\;\;\;\;\frac{t}{\frac{z}{x - y}}\\
\mathbf{elif}\;y \leq -7.5 \cdot 10^{-124}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-211}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{-82}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\mathbf{elif}\;y \leq 0.02:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{+150}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{-t}{\frac{z}{y} + -1}\\
\end{array}
\end{array}
if y < -1.8999999999999999e42Initial program 99.9%
Taylor expanded in x around 0 87.4%
neg-mul-187.4%
distribute-neg-frac87.4%
Simplified87.4%
if -1.8999999999999999e42 < y < -1.55e-13 or 0.0200000000000000004 < y < 2.45000000000000003e150Initial program 99.9%
Taylor expanded in z around 0 78.6%
mul-1-neg78.6%
div-sub78.6%
sub-neg78.6%
*-inverses78.6%
metadata-eval78.6%
Simplified78.6%
Taylor expanded in x around 0 78.6%
associate-*r/78.6%
*-commutative78.6%
neg-mul-178.6%
distribute-lft-neg-out78.6%
associate-*l/78.6%
*-lft-identity78.6%
distribute-rgt-in78.6%
distribute-frac-neg78.6%
sub-neg78.6%
Simplified78.6%
if -1.55e-13 < y < -2.6000000000000001e-61Initial program 99.7%
Taylor expanded in z around inf 83.8%
associate-/l*83.8%
Simplified83.8%
if -2.6000000000000001e-61 < y < -7.4999999999999996e-124Initial program 88.0%
Taylor expanded in z around inf 69.1%
associate-/l*57.2%
associate-/r/69.2%
Simplified69.2%
if -7.4999999999999996e-124 < y < -3.5e-211Initial program 99.6%
Taylor expanded in x around inf 93.2%
*-commutative93.2%
associate-*r/93.0%
Simplified93.0%
if -3.5e-211 < y < 4.7000000000000001e-82Initial program 97.2%
Taylor expanded in z around inf 89.1%
if 4.7000000000000001e-82 < y < 0.0200000000000000004Initial program 93.2%
Taylor expanded in x around inf 82.5%
if 2.45000000000000003e150 < y Initial program 99.9%
Taylor expanded in x around 0 66.4%
mul-1-neg66.4%
associate-/l*95.2%
distribute-neg-frac95.2%
div-sub95.2%
*-inverses95.2%
Simplified95.2%
Final simplification86.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ x (- z y)))) (t_2 (* t (- 1.0 (/ x y)))))
(if (<= y -1e-10)
t_2
(if (<= y -4.1e-65)
t_1
(if (<= y -1.35e-71)
t_2
(if (<= y -6.8e-119)
(* (- x y) (/ t z))
(if (<= y 7e-8) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (x / (z - y));
double t_2 = t * (1.0 - (x / y));
double tmp;
if (y <= -1e-10) {
tmp = t_2;
} else if (y <= -4.1e-65) {
tmp = t_1;
} else if (y <= -1.35e-71) {
tmp = t_2;
} else if (y <= -6.8e-119) {
tmp = (x - y) * (t / z);
} else if (y <= 7e-8) {
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 * (x / (z - y))
t_2 = t * (1.0d0 - (x / y))
if (y <= (-1d-10)) then
tmp = t_2
else if (y <= (-4.1d-65)) then
tmp = t_1
else if (y <= (-1.35d-71)) then
tmp = t_2
else if (y <= (-6.8d-119)) then
tmp = (x - y) * (t / z)
else if (y <= 7d-8) 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 * (x / (z - y));
double t_2 = t * (1.0 - (x / y));
double tmp;
if (y <= -1e-10) {
tmp = t_2;
} else if (y <= -4.1e-65) {
tmp = t_1;
} else if (y <= -1.35e-71) {
tmp = t_2;
} else if (y <= -6.8e-119) {
tmp = (x - y) * (t / z);
} else if (y <= 7e-8) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (x / (z - y)) t_2 = t * (1.0 - (x / y)) tmp = 0 if y <= -1e-10: tmp = t_2 elif y <= -4.1e-65: tmp = t_1 elif y <= -1.35e-71: tmp = t_2 elif y <= -6.8e-119: tmp = (x - y) * (t / z) elif y <= 7e-8: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(x / Float64(z - y))) t_2 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (y <= -1e-10) tmp = t_2; elseif (y <= -4.1e-65) tmp = t_1; elseif (y <= -1.35e-71) tmp = t_2; elseif (y <= -6.8e-119) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (y <= 7e-8) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (x / (z - y)); t_2 = t * (1.0 - (x / y)); tmp = 0.0; if (y <= -1e-10) tmp = t_2; elseif (y <= -4.1e-65) tmp = t_1; elseif (y <= -1.35e-71) tmp = t_2; elseif (y <= -6.8e-119) tmp = (x - y) * (t / z); elseif (y <= 7e-8) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e-10], t$95$2, If[LessEqual[y, -4.1e-65], t$95$1, If[LessEqual[y, -1.35e-71], t$95$2, If[LessEqual[y, -6.8e-119], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-8], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{x}{z - y}\\
t_2 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -1 \cdot 10^{-10}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -4.1 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-71}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -6.8 \cdot 10^{-119}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-8}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.00000000000000004e-10 or -4.09999999999999987e-65 < y < -1.3500000000000001e-71 or 7.00000000000000048e-8 < y Initial program 99.9%
Taylor expanded in z around 0 79.3%
mul-1-neg79.3%
div-sub79.3%
sub-neg79.3%
*-inverses79.3%
metadata-eval79.3%
Simplified79.3%
Taylor expanded in x around 0 73.0%
associate-*r/73.0%
*-commutative73.0%
neg-mul-173.0%
distribute-lft-neg-out73.0%
associate-*l/79.3%
*-lft-identity79.3%
distribute-rgt-in79.3%
distribute-frac-neg79.3%
sub-neg79.3%
Simplified79.3%
if -1.00000000000000004e-10 < y < -4.09999999999999987e-65 or -6.80000000000000047e-119 < y < 7.00000000000000048e-8Initial program 97.2%
Taylor expanded in x around inf 81.5%
if -1.3500000000000001e-71 < y < -6.80000000000000047e-119Initial program 81.0%
Taylor expanded in z around inf 90.1%
associate-/l*70.9%
associate-/r/90.1%
Simplified90.1%
Final simplification80.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ (- x y) z))) (t_2 (* t (- 1.0 (/ x y)))))
(if (<= y -9e-13)
t_2
(if (<= y -8.6e-64)
t_1
(if (<= y -4.5e-74)
t_2
(if (<= y -1e-211)
(* x (/ t (- z y)))
(if (<= y 5.5e-23) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = t * ((x - y) / z);
double t_2 = t * (1.0 - (x / y));
double tmp;
if (y <= -9e-13) {
tmp = t_2;
} else if (y <= -8.6e-64) {
tmp = t_1;
} else if (y <= -4.5e-74) {
tmp = t_2;
} else if (y <= -1e-211) {
tmp = x * (t / (z - y));
} else if (y <= 5.5e-23) {
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 * ((x - y) / z)
t_2 = t * (1.0d0 - (x / y))
if (y <= (-9d-13)) then
tmp = t_2
else if (y <= (-8.6d-64)) then
tmp = t_1
else if (y <= (-4.5d-74)) then
tmp = t_2
else if (y <= (-1d-211)) then
tmp = x * (t / (z - y))
else if (y <= 5.5d-23) 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 * ((x - y) / z);
double t_2 = t * (1.0 - (x / y));
double tmp;
if (y <= -9e-13) {
tmp = t_2;
} else if (y <= -8.6e-64) {
tmp = t_1;
} else if (y <= -4.5e-74) {
tmp = t_2;
} else if (y <= -1e-211) {
tmp = x * (t / (z - y));
} else if (y <= 5.5e-23) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * ((x - y) / z) t_2 = t * (1.0 - (x / y)) tmp = 0 if y <= -9e-13: tmp = t_2 elif y <= -8.6e-64: tmp = t_1 elif y <= -4.5e-74: tmp = t_2 elif y <= -1e-211: tmp = x * (t / (z - y)) elif y <= 5.5e-23: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(Float64(x - y) / z)) t_2 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (y <= -9e-13) tmp = t_2; elseif (y <= -8.6e-64) tmp = t_1; elseif (y <= -4.5e-74) tmp = t_2; elseif (y <= -1e-211) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 5.5e-23) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * ((x - y) / z); t_2 = t * (1.0 - (x / y)); tmp = 0.0; if (y <= -9e-13) tmp = t_2; elseif (y <= -8.6e-64) tmp = t_1; elseif (y <= -4.5e-74) tmp = t_2; elseif (y <= -1e-211) tmp = x * (t / (z - y)); elseif (y <= 5.5e-23) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9e-13], t$95$2, If[LessEqual[y, -8.6e-64], t$95$1, If[LessEqual[y, -4.5e-74], t$95$2, If[LessEqual[y, -1e-211], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e-23], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{x - y}{z}\\
t_2 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -9 \cdot 10^{-13}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -8.6 \cdot 10^{-64}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{-74}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-211}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-23}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -9e-13 or -8.59999999999999947e-64 < y < -4.4999999999999999e-74 or 5.5000000000000001e-23 < y Initial program 99.9%
Taylor expanded in z around 0 79.1%
mul-1-neg79.1%
div-sub79.1%
sub-neg79.1%
*-inverses79.1%
metadata-eval79.1%
Simplified79.1%
Taylor expanded in x around 0 72.9%
associate-*r/72.9%
*-commutative72.9%
neg-mul-172.9%
distribute-lft-neg-out72.9%
associate-*l/79.1%
*-lft-identity79.1%
distribute-rgt-in79.1%
distribute-frac-neg79.1%
sub-neg79.1%
Simplified79.1%
if -9e-13 < y < -8.59999999999999947e-64 or -1.00000000000000009e-211 < y < 5.5000000000000001e-23Initial program 96.7%
Taylor expanded in z around inf 86.3%
if -4.4999999999999999e-74 < y < -1.00000000000000009e-211Initial program 91.8%
Taylor expanded in x around inf 80.3%
*-commutative80.3%
associate-*r/80.2%
Simplified80.2%
Final simplification81.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ (- x y) z))) (t_2 (* t (- 1.0 (/ x y)))))
(if (<= y -1.9e-15)
t_2
(if (<= y -1.62e-65)
t_1
(if (<= y -2.4e-71)
(- t (* x (/ t y)))
(if (<= y -3.2e-211)
(* x (/ t (- z y)))
(if (<= y 2.4e-23) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = t * ((x - y) / z);
double t_2 = t * (1.0 - (x / y));
double tmp;
if (y <= -1.9e-15) {
tmp = t_2;
} else if (y <= -1.62e-65) {
tmp = t_1;
} else if (y <= -2.4e-71) {
tmp = t - (x * (t / y));
} else if (y <= -3.2e-211) {
tmp = x * (t / (z - y));
} else if (y <= 2.4e-23) {
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 * ((x - y) / z)
t_2 = t * (1.0d0 - (x / y))
if (y <= (-1.9d-15)) then
tmp = t_2
else if (y <= (-1.62d-65)) then
tmp = t_1
else if (y <= (-2.4d-71)) then
tmp = t - (x * (t / y))
else if (y <= (-3.2d-211)) then
tmp = x * (t / (z - y))
else if (y <= 2.4d-23) 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 * ((x - y) / z);
double t_2 = t * (1.0 - (x / y));
double tmp;
if (y <= -1.9e-15) {
tmp = t_2;
} else if (y <= -1.62e-65) {
tmp = t_1;
} else if (y <= -2.4e-71) {
tmp = t - (x * (t / y));
} else if (y <= -3.2e-211) {
tmp = x * (t / (z - y));
} else if (y <= 2.4e-23) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * ((x - y) / z) t_2 = t * (1.0 - (x / y)) tmp = 0 if y <= -1.9e-15: tmp = t_2 elif y <= -1.62e-65: tmp = t_1 elif y <= -2.4e-71: tmp = t - (x * (t / y)) elif y <= -3.2e-211: tmp = x * (t / (z - y)) elif y <= 2.4e-23: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(Float64(x - y) / z)) t_2 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (y <= -1.9e-15) tmp = t_2; elseif (y <= -1.62e-65) tmp = t_1; elseif (y <= -2.4e-71) tmp = Float64(t - Float64(x * Float64(t / y))); elseif (y <= -3.2e-211) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 2.4e-23) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * ((x - y) / z); t_2 = t * (1.0 - (x / y)); tmp = 0.0; if (y <= -1.9e-15) tmp = t_2; elseif (y <= -1.62e-65) tmp = t_1; elseif (y <= -2.4e-71) tmp = t - (x * (t / y)); elseif (y <= -3.2e-211) tmp = x * (t / (z - y)); elseif (y <= 2.4e-23) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.9e-15], t$95$2, If[LessEqual[y, -1.62e-65], t$95$1, If[LessEqual[y, -2.4e-71], N[(t - N[(x * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.2e-211], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e-23], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{x - y}{z}\\
t_2 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{-15}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.62 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{-71}:\\
\;\;\;\;t - x \cdot \frac{t}{y}\\
\mathbf{elif}\;y \leq -3.2 \cdot 10^{-211}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-23}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.9000000000000001e-15 or 2.39999999999999996e-23 < y Initial program 99.9%
Taylor expanded in z around 0 78.5%
mul-1-neg78.5%
div-sub78.5%
sub-neg78.5%
*-inverses78.5%
metadata-eval78.5%
Simplified78.5%
Taylor expanded in x around 0 72.1%
associate-*r/72.1%
*-commutative72.1%
neg-mul-172.1%
distribute-lft-neg-out72.1%
associate-*l/78.5%
*-lft-identity78.5%
distribute-rgt-in78.5%
distribute-frac-neg78.5%
sub-neg78.5%
Simplified78.5%
if -1.9000000000000001e-15 < y < -1.6200000000000001e-65 or -3.19999999999999985e-211 < y < 2.39999999999999996e-23Initial program 96.7%
Taylor expanded in z around inf 86.3%
if -1.6200000000000001e-65 < y < -2.4e-71Initial program 99.6%
Taylor expanded in z around 0 99.6%
mul-1-neg99.6%
div-sub99.6%
sub-neg99.6%
*-inverses99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 100.0%
associate-*r/100.0%
*-commutative100.0%
neg-mul-1100.0%
distribute-lft-neg-out100.0%
associate-*l/100.0%
*-lft-identity100.0%
distribute-rgt-in99.6%
distribute-frac-neg99.6%
sub-neg99.6%
Simplified99.6%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
associate-*l/100.0%
*-commutative100.0%
distribute-lft-neg-in100.0%
cancel-sign-sub-inv100.0%
Simplified100.0%
if -2.4e-71 < y < -3.19999999999999985e-211Initial program 91.8%
Taylor expanded in x around inf 80.3%
*-commutative80.3%
associate-*r/80.2%
Simplified80.2%
Final simplification81.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- 1.0 (/ x y)))))
(if (<= y -1.56e-16)
t_1
(if (<= y -8e-65)
(* t (/ x z))
(if (or (<= y -1.6e-71) (not (<= y 9.5e-5)))
t_1
(* x (/ t (- z y))))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (y <= -1.56e-16) {
tmp = t_1;
} else if (y <= -8e-65) {
tmp = t * (x / z);
} else if ((y <= -1.6e-71) || !(y <= 9.5e-5)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = t * (1.0d0 - (x / y))
if (y <= (-1.56d-16)) then
tmp = t_1
else if (y <= (-8d-65)) then
tmp = t * (x / z)
else if ((y <= (-1.6d-71)) .or. (.not. (y <= 9.5d-5))) then
tmp = t_1
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 t_1 = t * (1.0 - (x / y));
double tmp;
if (y <= -1.56e-16) {
tmp = t_1;
} else if (y <= -8e-65) {
tmp = t * (x / z);
} else if ((y <= -1.6e-71) || !(y <= 9.5e-5)) {
tmp = t_1;
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (1.0 - (x / y)) tmp = 0 if y <= -1.56e-16: tmp = t_1 elif y <= -8e-65: tmp = t * (x / z) elif (y <= -1.6e-71) or not (y <= 9.5e-5): tmp = t_1 else: tmp = x * (t / (z - y)) return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (y <= -1.56e-16) tmp = t_1; elseif (y <= -8e-65) tmp = Float64(t * Float64(x / z)); elseif ((y <= -1.6e-71) || !(y <= 9.5e-5)) tmp = t_1; else tmp = Float64(x * Float64(t / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (1.0 - (x / y)); tmp = 0.0; if (y <= -1.56e-16) tmp = t_1; elseif (y <= -8e-65) tmp = t * (x / z); elseif ((y <= -1.6e-71) || ~((y <= 9.5e-5))) tmp = t_1; else tmp = x * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.56e-16], t$95$1, If[LessEqual[y, -8e-65], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -1.6e-71], N[Not[LessEqual[y, 9.5e-5]], $MachinePrecision]], t$95$1, N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -1.56 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -8 \cdot 10^{-65}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq -1.6 \cdot 10^{-71} \lor \neg \left(y \leq 9.5 \cdot 10^{-5}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -1.55999999999999996e-16 or -7.99999999999999939e-65 < y < -1.5999999999999999e-71 or 9.5000000000000005e-5 < y Initial program 99.9%
Taylor expanded in z around 0 79.5%
mul-1-neg79.5%
div-sub79.5%
sub-neg79.5%
*-inverses79.5%
metadata-eval79.5%
Simplified79.5%
Taylor expanded in x around 0 73.2%
associate-*r/73.2%
*-commutative73.2%
neg-mul-173.2%
distribute-lft-neg-out73.2%
associate-*l/79.5%
*-lft-identity79.5%
distribute-rgt-in79.5%
distribute-frac-neg79.5%
sub-neg79.5%
Simplified79.5%
if -1.55999999999999996e-16 < y < -7.99999999999999939e-65Initial program 99.8%
Taylor expanded in y around 0 70.1%
if -1.5999999999999999e-71 < y < 9.5000000000000005e-5Initial program 95.5%
Taylor expanded in x around inf 76.2%
*-commutative76.2%
associate-*r/78.4%
Simplified78.4%
Final simplification78.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- 1.0 (/ x y)))))
(if (<= y -2.4e-18)
t_1
(if (<= y -1.06e-64)
(* t (/ x z))
(if (or (<= y -1.9e-72) (not (<= y 1.85e-21)))
t_1
(* (- x y) (/ t z)))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (y <= -2.4e-18) {
tmp = t_1;
} else if (y <= -1.06e-64) {
tmp = t * (x / z);
} else if ((y <= -1.9e-72) || !(y <= 1.85e-21)) {
tmp = t_1;
} else {
tmp = (x - y) * (t / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = t * (1.0d0 - (x / y))
if (y <= (-2.4d-18)) then
tmp = t_1
else if (y <= (-1.06d-64)) then
tmp = t * (x / z)
else if ((y <= (-1.9d-72)) .or. (.not. (y <= 1.85d-21))) then
tmp = t_1
else
tmp = (x - y) * (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (y <= -2.4e-18) {
tmp = t_1;
} else if (y <= -1.06e-64) {
tmp = t * (x / z);
} else if ((y <= -1.9e-72) || !(y <= 1.85e-21)) {
tmp = t_1;
} else {
tmp = (x - y) * (t / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (1.0 - (x / y)) tmp = 0 if y <= -2.4e-18: tmp = t_1 elif y <= -1.06e-64: tmp = t * (x / z) elif (y <= -1.9e-72) or not (y <= 1.85e-21): tmp = t_1 else: tmp = (x - y) * (t / z) return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (y <= -2.4e-18) tmp = t_1; elseif (y <= -1.06e-64) tmp = Float64(t * Float64(x / z)); elseif ((y <= -1.9e-72) || !(y <= 1.85e-21)) tmp = t_1; else tmp = Float64(Float64(x - y) * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (1.0 - (x / y)); tmp = 0.0; if (y <= -2.4e-18) tmp = t_1; elseif (y <= -1.06e-64) tmp = t * (x / z); elseif ((y <= -1.9e-72) || ~((y <= 1.85e-21))) tmp = t_1; else tmp = (x - y) * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.4e-18], t$95$1, If[LessEqual[y, -1.06e-64], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -1.9e-72], N[Not[LessEqual[y, 1.85e-21]], $MachinePrecision]], t$95$1, N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{-18}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.06 \cdot 10^{-64}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq -1.9 \cdot 10^{-72} \lor \neg \left(y \leq 1.85 \cdot 10^{-21}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\end{array}
\end{array}
if y < -2.39999999999999994e-18 or -1.06000000000000007e-64 < y < -1.90000000000000001e-72 or 1.8500000000000001e-21 < y Initial program 99.9%
Taylor expanded in z around 0 79.1%
mul-1-neg79.1%
div-sub79.1%
sub-neg79.1%
*-inverses79.1%
metadata-eval79.1%
Simplified79.1%
Taylor expanded in x around 0 72.9%
associate-*r/72.9%
*-commutative72.9%
neg-mul-172.9%
distribute-lft-neg-out72.9%
associate-*l/79.1%
*-lft-identity79.1%
distribute-rgt-in79.1%
distribute-frac-neg79.1%
sub-neg79.1%
Simplified79.1%
if -2.39999999999999994e-18 < y < -1.06000000000000007e-64Initial program 99.8%
Taylor expanded in y around 0 70.1%
if -1.90000000000000001e-72 < y < 1.8500000000000001e-21Initial program 95.4%
Taylor expanded in z around inf 77.2%
associate-/l*81.9%
associate-/r/79.9%
Simplified79.9%
Final simplification79.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.7e+118)
t
(if (<= y -1.02e+36)
(* y (/ (- t) z))
(if (<= y -3.9e-17) t (if (<= y 0.4) (* t (/ x z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e+118) {
tmp = t;
} else if (y <= -1.02e+36) {
tmp = y * (-t / z);
} else if (y <= -3.9e-17) {
tmp = t;
} else if (y <= 0.4) {
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 <= (-1.7d+118)) then
tmp = t
else if (y <= (-1.02d+36)) then
tmp = y * (-t / z)
else if (y <= (-3.9d-17)) then
tmp = t
else if (y <= 0.4d0) 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 <= -1.7e+118) {
tmp = t;
} else if (y <= -1.02e+36) {
tmp = y * (-t / z);
} else if (y <= -3.9e-17) {
tmp = t;
} else if (y <= 0.4) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.7e+118: tmp = t elif y <= -1.02e+36: tmp = y * (-t / z) elif y <= -3.9e-17: tmp = t elif y <= 0.4: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e+118) tmp = t; elseif (y <= -1.02e+36) tmp = Float64(y * Float64(Float64(-t) / z)); elseif (y <= -3.9e-17) tmp = t; elseif (y <= 0.4) 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 <= -1.7e+118) tmp = t; elseif (y <= -1.02e+36) tmp = y * (-t / z); elseif (y <= -3.9e-17) tmp = t; elseif (y <= 0.4) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.7e+118], t, If[LessEqual[y, -1.02e+36], N[(y * N[((-t) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.9e-17], t, If[LessEqual[y, 0.4], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+118}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -1.02 \cdot 10^{+36}:\\
\;\;\;\;y \cdot \frac{-t}{z}\\
\mathbf{elif}\;y \leq -3.9 \cdot 10^{-17}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 0.4:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.69999999999999993e118 or -1.02000000000000003e36 < y < -3.89999999999999989e-17 or 0.40000000000000002 < y Initial program 99.9%
Taylor expanded in y around inf 69.8%
if -1.69999999999999993e118 < y < -1.02000000000000003e36Initial program 99.7%
Taylor expanded in x around 0 74.2%
neg-mul-174.2%
distribute-neg-frac74.2%
Simplified74.2%
Taylor expanded in y around 0 50.6%
mul-1-neg50.6%
*-commutative50.6%
associate-*r/50.5%
distribute-rgt-neg-in50.5%
distribute-neg-frac50.5%
Simplified50.5%
if -3.89999999999999989e-17 < y < 0.40000000000000002Initial program 95.9%
Taylor expanded in y around 0 68.9%
Final simplification68.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1e-17) (not (<= y 8.8e-24))) (* t (- 1.0 (/ x y))) (* t (/ x z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1e-17) || !(y <= 8.8e-24)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t * (x / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1d-17)) .or. (.not. (y <= 8.8d-24))) then
tmp = t * (1.0d0 - (x / y))
else
tmp = t * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1e-17) || !(y <= 8.8e-24)) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t * (x / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1e-17) or not (y <= 8.8e-24): tmp = t * (1.0 - (x / y)) else: tmp = t * (x / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1e-17) || !(y <= 8.8e-24)) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = Float64(t * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1e-17) || ~((y <= 8.8e-24))) tmp = t * (1.0 - (x / y)); else tmp = t * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1e-17], N[Not[LessEqual[y, 8.8e-24]], $MachinePrecision]], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-17} \lor \neg \left(y \leq 8.8 \cdot 10^{-24}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\end{array}
\end{array}
if y < -1.00000000000000007e-17 or 8.80000000000000006e-24 < y Initial program 99.9%
Taylor expanded in z around 0 78.5%
mul-1-neg78.5%
div-sub78.5%
sub-neg78.5%
*-inverses78.5%
metadata-eval78.5%
Simplified78.5%
Taylor expanded in x around 0 72.1%
associate-*r/72.1%
*-commutative72.1%
neg-mul-172.1%
distribute-lft-neg-out72.1%
associate-*l/78.5%
*-lft-identity78.5%
distribute-rgt-in78.5%
distribute-frac-neg78.5%
sub-neg78.5%
Simplified78.5%
if -1.00000000000000007e-17 < y < 8.80000000000000006e-24Initial program 95.8%
Taylor expanded in y around 0 69.2%
Final simplification74.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1.25e-16) t (if (<= y 7e-5) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.25e-16) {
tmp = t;
} else if (y <= 7e-5) {
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 <= (-1.25d-16)) then
tmp = t
else if (y <= 7d-5) 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 <= -1.25e-16) {
tmp = t;
} else if (y <= 7e-5) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.25e-16: tmp = t elif y <= 7e-5: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.25e-16) tmp = t; elseif (y <= 7e-5) 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 <= -1.25e-16) tmp = t; elseif (y <= 7e-5) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.25e-16], t, If[LessEqual[y, 7e-5], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-16}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-5}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.2500000000000001e-16 or 6.9999999999999994e-5 < y Initial program 99.9%
Taylor expanded in y around inf 64.5%
if -1.2500000000000001e-16 < y < 6.9999999999999994e-5Initial program 95.9%
Taylor expanded in y around 0 68.9%
Final simplification66.6%
(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 98.0%
Taylor expanded in y around inf 38.3%
Final simplification38.3%
(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 2023322
(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))