
(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 97.7%
Final simplification97.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ y (- y z)))) (t_2 (/ t (/ y (- x)))) (t_3 (* x (/ t z))))
(if (<= x -2e+117)
t_2
(if (<= x -1.26e+57)
t_1
(if (<= x -1.28e-30)
(/ t (/ z x))
(if (<= x 1.8e+22)
t_1
(if (<= x 1.02e+169)
t_3
(if (<= x 1.05e+217)
(* (- x) (/ t y))
(if (<= x 8.2e+241) t_3 t_2)))))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (y / (y - z));
double t_2 = t / (y / -x);
double t_3 = x * (t / z);
double tmp;
if (x <= -2e+117) {
tmp = t_2;
} else if (x <= -1.26e+57) {
tmp = t_1;
} else if (x <= -1.28e-30) {
tmp = t / (z / x);
} else if (x <= 1.8e+22) {
tmp = t_1;
} else if (x <= 1.02e+169) {
tmp = t_3;
} else if (x <= 1.05e+217) {
tmp = -x * (t / y);
} else if (x <= 8.2e+241) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_1 = t * (y / (y - z))
t_2 = t / (y / -x)
t_3 = x * (t / z)
if (x <= (-2d+117)) then
tmp = t_2
else if (x <= (-1.26d+57)) then
tmp = t_1
else if (x <= (-1.28d-30)) then
tmp = t / (z / x)
else if (x <= 1.8d+22) then
tmp = t_1
else if (x <= 1.02d+169) then
tmp = t_3
else if (x <= 1.05d+217) then
tmp = -x * (t / y)
else if (x <= 8.2d+241) then
tmp = t_3
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 * (y / (y - z));
double t_2 = t / (y / -x);
double t_3 = x * (t / z);
double tmp;
if (x <= -2e+117) {
tmp = t_2;
} else if (x <= -1.26e+57) {
tmp = t_1;
} else if (x <= -1.28e-30) {
tmp = t / (z / x);
} else if (x <= 1.8e+22) {
tmp = t_1;
} else if (x <= 1.02e+169) {
tmp = t_3;
} else if (x <= 1.05e+217) {
tmp = -x * (t / y);
} else if (x <= 8.2e+241) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (y / (y - z)) t_2 = t / (y / -x) t_3 = x * (t / z) tmp = 0 if x <= -2e+117: tmp = t_2 elif x <= -1.26e+57: tmp = t_1 elif x <= -1.28e-30: tmp = t / (z / x) elif x <= 1.8e+22: tmp = t_1 elif x <= 1.02e+169: tmp = t_3 elif x <= 1.05e+217: tmp = -x * (t / y) elif x <= 8.2e+241: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(y / Float64(y - z))) t_2 = Float64(t / Float64(y / Float64(-x))) t_3 = Float64(x * Float64(t / z)) tmp = 0.0 if (x <= -2e+117) tmp = t_2; elseif (x <= -1.26e+57) tmp = t_1; elseif (x <= -1.28e-30) tmp = Float64(t / Float64(z / x)); elseif (x <= 1.8e+22) tmp = t_1; elseif (x <= 1.02e+169) tmp = t_3; elseif (x <= 1.05e+217) tmp = Float64(Float64(-x) * Float64(t / y)); elseif (x <= 8.2e+241) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (y / (y - z)); t_2 = t / (y / -x); t_3 = x * (t / z); tmp = 0.0; if (x <= -2e+117) tmp = t_2; elseif (x <= -1.26e+57) tmp = t_1; elseif (x <= -1.28e-30) tmp = t / (z / x); elseif (x <= 1.8e+22) tmp = t_1; elseif (x <= 1.02e+169) tmp = t_3; elseif (x <= 1.05e+217) tmp = -x * (t / y); elseif (x <= 8.2e+241) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t / N[(y / (-x)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2e+117], t$95$2, If[LessEqual[x, -1.26e+57], t$95$1, If[LessEqual[x, -1.28e-30], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.8e+22], t$95$1, If[LessEqual[x, 1.02e+169], t$95$3, If[LessEqual[x, 1.05e+217], N[((-x) * N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.2e+241], t$95$3, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{y - z}\\
t_2 := \frac{t}{\frac{y}{-x}}\\
t_3 := x \cdot \frac{t}{z}\\
\mathbf{if}\;x \leq -2 \cdot 10^{+117}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1.26 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.28 \cdot 10^{-30}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{+169}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+217}:\\
\;\;\;\;\left(-x\right) \cdot \frac{t}{y}\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{+241}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -2.0000000000000001e117 or 8.2000000000000003e241 < x Initial program 99.7%
associate-*l/82.3%
associate-/l*87.1%
Simplified87.1%
associate-*r/82.3%
associate-*l/99.7%
*-commutative99.7%
clear-num99.7%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 89.9%
Taylor expanded in z around 0 59.0%
neg-mul-159.0%
distribute-neg-frac259.0%
Simplified59.0%
if -2.0000000000000001e117 < x < -1.26e57 or -1.28000000000000007e-30 < x < 1.8e22Initial program 97.3%
Taylor expanded in x around 0 80.1%
neg-mul-180.1%
distribute-neg-frac80.1%
Simplified80.1%
*-commutative80.1%
distribute-frac-neg80.1%
distribute-frac-neg280.1%
associate-*r/67.3%
sub-neg67.3%
distribute-neg-in67.3%
remove-double-neg67.3%
Applied egg-rr67.3%
associate-/l*80.1%
+-commutative80.1%
unsub-neg80.1%
Simplified80.1%
if -1.26e57 < x < -1.28000000000000007e-30Initial program 99.4%
associate-*l/89.4%
associate-/l*97.6%
Simplified97.6%
associate-*r/89.4%
associate-*l/99.4%
*-commutative99.4%
clear-num99.3%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 78.5%
if 1.8e22 < x < 1.02000000000000005e169 or 1.05e217 < x < 8.2000000000000003e241Initial program 95.1%
Taylor expanded in y around 0 64.2%
*-commutative64.2%
clear-num64.2%
un-div-inv64.1%
Applied egg-rr64.1%
associate-/r/68.5%
Simplified68.5%
if 1.02000000000000005e169 < x < 1.05e217Initial program 99.2%
associate-*l/90.4%
associate-/l*80.8%
Simplified80.8%
Taylor expanded in x around inf 90.4%
Taylor expanded in z around 0 71.4%
associate-*r/71.4%
mul-1-neg71.4%
distribute-rgt-neg-out71.4%
Simplified71.4%
frac-2neg71.4%
distribute-frac-neg71.4%
add-sqr-sqrt11.5%
sqrt-unprod12.1%
sqr-neg12.1%
sqrt-unprod0.6%
add-sqr-sqrt1.1%
div-inv1.1%
*-commutative1.1%
associate-*l*1.3%
add-sqr-sqrt0.0%
sqrt-unprod23.2%
sqr-neg23.2%
sqrt-unprod80.3%
add-sqr-sqrt79.9%
add-sqr-sqrt59.4%
sqrt-unprod60.3%
sqr-neg60.3%
sqrt-unprod0.7%
add-sqr-sqrt1.3%
div-inv1.3%
add-sqr-sqrt0.7%
sqrt-unprod60.7%
sqr-neg60.7%
sqrt-unprod59.6%
add-sqr-sqrt80.5%
Applied egg-rr80.5%
distribute-rgt-neg-in80.5%
mul-1-neg80.5%
associate-*r/80.5%
neg-mul-180.5%
Simplified80.5%
Final simplification73.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.85e+112)
t
(if (<= y -1900000000000.0)
(* t (/ x z))
(if (<= y -7.6e-15)
t
(if (<= y 5000000.0)
(* x (/ t z))
(if (<= y 1.5e+86) (* (- x) (/ t y)) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.85e+112) {
tmp = t;
} else if (y <= -1900000000000.0) {
tmp = t * (x / z);
} else if (y <= -7.6e-15) {
tmp = t;
} else if (y <= 5000000.0) {
tmp = x * (t / z);
} else if (y <= 1.5e+86) {
tmp = -x * (t / 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 <= (-1.85d+112)) then
tmp = t
else if (y <= (-1900000000000.0d0)) then
tmp = t * (x / z)
else if (y <= (-7.6d-15)) then
tmp = t
else if (y <= 5000000.0d0) then
tmp = x * (t / z)
else if (y <= 1.5d+86) then
tmp = -x * (t / 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 <= -1.85e+112) {
tmp = t;
} else if (y <= -1900000000000.0) {
tmp = t * (x / z);
} else if (y <= -7.6e-15) {
tmp = t;
} else if (y <= 5000000.0) {
tmp = x * (t / z);
} else if (y <= 1.5e+86) {
tmp = -x * (t / y);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.85e+112: tmp = t elif y <= -1900000000000.0: tmp = t * (x / z) elif y <= -7.6e-15: tmp = t elif y <= 5000000.0: tmp = x * (t / z) elif y <= 1.5e+86: tmp = -x * (t / y) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.85e+112) tmp = t; elseif (y <= -1900000000000.0) tmp = Float64(t * Float64(x / z)); elseif (y <= -7.6e-15) tmp = t; elseif (y <= 5000000.0) tmp = Float64(x * Float64(t / z)); elseif (y <= 1.5e+86) tmp = Float64(Float64(-x) * Float64(t / y)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.85e+112) tmp = t; elseif (y <= -1900000000000.0) tmp = t * (x / z); elseif (y <= -7.6e-15) tmp = t; elseif (y <= 5000000.0) tmp = x * (t / z); elseif (y <= 1.5e+86) tmp = -x * (t / y); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.85e+112], t, If[LessEqual[y, -1900000000000.0], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.6e-15], t, If[LessEqual[y, 5000000.0], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e+86], N[((-x) * N[(t / y), $MachinePrecision]), $MachinePrecision], t]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{+112}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -1900000000000:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq -7.6 \cdot 10^{-15}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 5000000:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+86}:\\
\;\;\;\;\left(-x\right) \cdot \frac{t}{y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.85000000000000002e112 or -1.9e12 < y < -7.6000000000000004e-15 or 1.49999999999999988e86 < y Initial program 99.9%
associate-*l/73.2%
associate-/l*73.2%
Simplified73.2%
Taylor expanded in y around inf 68.9%
if -1.85000000000000002e112 < y < -1.9e12Initial program 99.7%
Taylor expanded in y around 0 49.2%
if -7.6000000000000004e-15 < y < 5e6Initial program 95.7%
Taylor expanded in y around 0 65.5%
*-commutative65.5%
clear-num65.4%
un-div-inv65.5%
Applied egg-rr65.5%
associate-/r/65.8%
Simplified65.8%
if 5e6 < y < 1.49999999999999988e86Initial program 99.5%
associate-*l/89.8%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in x around inf 57.4%
Taylor expanded in z around 0 49.7%
associate-*r/49.7%
mul-1-neg49.7%
distribute-rgt-neg-out49.7%
Simplified49.7%
frac-2neg49.7%
distribute-frac-neg49.7%
add-sqr-sqrt0.0%
sqrt-unprod7.1%
sqr-neg7.1%
sqrt-unprod7.1%
add-sqr-sqrt7.1%
div-inv7.1%
*-commutative7.1%
associate-*l*7.1%
add-sqr-sqrt6.4%
sqrt-unprod21.8%
sqr-neg21.8%
sqrt-unprod39.3%
add-sqr-sqrt53.9%
add-sqr-sqrt53.7%
sqrt-unprod53.9%
sqr-neg53.9%
sqrt-unprod0.0%
add-sqr-sqrt7.1%
div-inv7.1%
add-sqr-sqrt0.0%
sqrt-unprod54.1%
sqr-neg54.1%
sqrt-unprod53.8%
add-sqr-sqrt54.1%
Applied egg-rr54.1%
distribute-rgt-neg-in54.1%
mul-1-neg54.1%
associate-*r/54.1%
neg-mul-154.1%
Simplified54.1%
Final simplification64.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.2e+114)
t
(if (<= y -2000000000000.0)
(* t (/ x z))
(if (<= y -1.02e-15)
t
(if (<= y 6200000.0)
(* x (/ t z))
(if (<= y 1.05e+86) (/ t (/ y (- x))) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.2e+114) {
tmp = t;
} else if (y <= -2000000000000.0) {
tmp = t * (x / z);
} else if (y <= -1.02e-15) {
tmp = t;
} else if (y <= 6200000.0) {
tmp = x * (t / z);
} else if (y <= 1.05e+86) {
tmp = t / (y / -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 <= (-1.2d+114)) then
tmp = t
else if (y <= (-2000000000000.0d0)) then
tmp = t * (x / z)
else if (y <= (-1.02d-15)) then
tmp = t
else if (y <= 6200000.0d0) then
tmp = x * (t / z)
else if (y <= 1.05d+86) then
tmp = t / (y / -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 <= -1.2e+114) {
tmp = t;
} else if (y <= -2000000000000.0) {
tmp = t * (x / z);
} else if (y <= -1.02e-15) {
tmp = t;
} else if (y <= 6200000.0) {
tmp = x * (t / z);
} else if (y <= 1.05e+86) {
tmp = t / (y / -x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.2e+114: tmp = t elif y <= -2000000000000.0: tmp = t * (x / z) elif y <= -1.02e-15: tmp = t elif y <= 6200000.0: tmp = x * (t / z) elif y <= 1.05e+86: tmp = t / (y / -x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.2e+114) tmp = t; elseif (y <= -2000000000000.0) tmp = Float64(t * Float64(x / z)); elseif (y <= -1.02e-15) tmp = t; elseif (y <= 6200000.0) tmp = Float64(x * Float64(t / z)); elseif (y <= 1.05e+86) tmp = Float64(t / Float64(y / Float64(-x))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.2e+114) tmp = t; elseif (y <= -2000000000000.0) tmp = t * (x / z); elseif (y <= -1.02e-15) tmp = t; elseif (y <= 6200000.0) tmp = x * (t / z); elseif (y <= 1.05e+86) tmp = t / (y / -x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.2e+114], t, If[LessEqual[y, -2000000000000.0], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.02e-15], t, If[LessEqual[y, 6200000.0], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e+86], N[(t / N[(y / (-x)), $MachinePrecision]), $MachinePrecision], t]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+114}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -2000000000000:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq -1.02 \cdot 10^{-15}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 6200000:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+86}:\\
\;\;\;\;\frac{t}{\frac{y}{-x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.2e114 or -2e12 < y < -1.02e-15 or 1.0499999999999999e86 < y Initial program 99.9%
associate-*l/73.2%
associate-/l*73.2%
Simplified73.2%
Taylor expanded in y around inf 68.9%
if -1.2e114 < y < -2e12Initial program 99.7%
Taylor expanded in y around 0 49.2%
if -1.02e-15 < y < 6.2e6Initial program 95.7%
Taylor expanded in y around 0 65.5%
*-commutative65.5%
clear-num65.4%
un-div-inv65.5%
Applied egg-rr65.5%
associate-/r/65.8%
Simplified65.8%
if 6.2e6 < y < 1.0499999999999999e86Initial program 99.5%
associate-*l/89.8%
associate-/l*96.1%
Simplified96.1%
associate-*r/89.8%
associate-*l/99.5%
*-commutative99.5%
clear-num99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 65.5%
Taylor expanded in z around 0 55.1%
neg-mul-155.1%
distribute-neg-frac255.1%
Simplified55.1%
Final simplification64.3%
(FPCore (x y z t)
:precision binary64
(if (<= x -1.3e+129)
(* t (/ x (- z y)))
(if (<= x -3.9e+90)
(* (+ (/ x y) -1.0) (- t))
(if (or (<= x -1.3e-30) (not (<= x 4.7e+30)))
(/ t (/ (- z y) x))
(* t (/ y (- y z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.3e+129) {
tmp = t * (x / (z - y));
} else if (x <= -3.9e+90) {
tmp = ((x / y) + -1.0) * -t;
} else if ((x <= -1.3e-30) || !(x <= 4.7e+30)) {
tmp = t / ((z - y) / x);
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-1.3d+129)) then
tmp = t * (x / (z - y))
else if (x <= (-3.9d+90)) then
tmp = ((x / y) + (-1.0d0)) * -t
else if ((x <= (-1.3d-30)) .or. (.not. (x <= 4.7d+30))) then
tmp = t / ((z - y) / x)
else
tmp = t * (y / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.3e+129) {
tmp = t * (x / (z - y));
} else if (x <= -3.9e+90) {
tmp = ((x / y) + -1.0) * -t;
} else if ((x <= -1.3e-30) || !(x <= 4.7e+30)) {
tmp = t / ((z - y) / x);
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.3e+129: tmp = t * (x / (z - y)) elif x <= -3.9e+90: tmp = ((x / y) + -1.0) * -t elif (x <= -1.3e-30) or not (x <= 4.7e+30): tmp = t / ((z - y) / x) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.3e+129) tmp = Float64(t * Float64(x / Float64(z - y))); elseif (x <= -3.9e+90) tmp = Float64(Float64(Float64(x / y) + -1.0) * Float64(-t)); elseif ((x <= -1.3e-30) || !(x <= 4.7e+30)) tmp = Float64(t / Float64(Float64(z - y) / x)); else tmp = Float64(t * Float64(y / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.3e+129) tmp = t * (x / (z - y)); elseif (x <= -3.9e+90) tmp = ((x / y) + -1.0) * -t; elseif ((x <= -1.3e-30) || ~((x <= 4.7e+30))) tmp = t / ((z - y) / x); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.3e+129], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.9e+90], N[(N[(N[(x / y), $MachinePrecision] + -1.0), $MachinePrecision] * (-t)), $MachinePrecision], If[Or[LessEqual[x, -1.3e-30], N[Not[LessEqual[x, 4.7e+30]], $MachinePrecision]], N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{+129}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{elif}\;x \leq -3.9 \cdot 10^{+90}:\\
\;\;\;\;\left(\frac{x}{y} + -1\right) \cdot \left(-t\right)\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-30} \lor \neg \left(x \leq 4.7 \cdot 10^{+30}\right):\\
\;\;\;\;\frac{t}{\frac{z - y}{x}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if x < -1.30000000000000006e129Initial program 99.7%
Taylor expanded in x around inf 88.3%
if -1.30000000000000006e129 < x < -3.9000000000000002e90Initial program 99.8%
Taylor expanded in z around 0 99.8%
mul-1-neg99.8%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
if -3.9000000000000002e90 < x < -1.29999999999999993e-30 or 4.6999999999999999e30 < x Initial program 97.7%
associate-*l/88.2%
associate-/l*87.5%
Simplified87.5%
associate-*r/88.2%
associate-*l/97.7%
*-commutative97.7%
clear-num97.6%
un-div-inv97.8%
Applied egg-rr97.8%
Taylor expanded in x around inf 84.0%
if -1.29999999999999993e-30 < x < 4.6999999999999999e30Initial program 97.1%
Taylor expanded in x around 0 81.0%
neg-mul-181.0%
distribute-neg-frac81.0%
Simplified81.0%
*-commutative81.0%
distribute-frac-neg81.0%
distribute-frac-neg281.0%
associate-*r/67.9%
sub-neg67.9%
distribute-neg-in67.9%
remove-double-neg67.9%
Applied egg-rr67.9%
associate-/l*81.0%
+-commutative81.0%
unsub-neg81.0%
Simplified81.0%
Final simplification83.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.56e+102)
t
(if (or (<= y -1700000000000.0)
(and (not (<= y -1.75e-14)) (<= y 2000000.0)))
(* x (/ t z))
t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.56e+102) {
tmp = t;
} else if ((y <= -1700000000000.0) || (!(y <= -1.75e-14) && (y <= 2000000.0))) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.56d+102)) then
tmp = t
else if ((y <= (-1700000000000.0d0)) .or. (.not. (y <= (-1.75d-14))) .and. (y <= 2000000.0d0)) then
tmp = x * (t / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.56e+102) {
tmp = t;
} else if ((y <= -1700000000000.0) || (!(y <= -1.75e-14) && (y <= 2000000.0))) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.56e+102: tmp = t elif (y <= -1700000000000.0) or (not (y <= -1.75e-14) and (y <= 2000000.0)): tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.56e+102) tmp = t; elseif ((y <= -1700000000000.0) || (!(y <= -1.75e-14) && (y <= 2000000.0))) tmp = Float64(x * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.56e+102) tmp = t; elseif ((y <= -1700000000000.0) || (~((y <= -1.75e-14)) && (y <= 2000000.0))) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.56e+102], t, If[Or[LessEqual[y, -1700000000000.0], And[N[Not[LessEqual[y, -1.75e-14]], $MachinePrecision], LessEqual[y, 2000000.0]]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.56 \cdot 10^{+102}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -1700000000000 \lor \neg \left(y \leq -1.75 \cdot 10^{-14}\right) \land y \leq 2000000:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.56e102 or -1.7e12 < y < -1.7500000000000001e-14 or 2e6 < y Initial program 99.8%
associate-*l/76.5%
associate-/l*77.7%
Simplified77.7%
Taylor expanded in y around inf 58.5%
if -1.56e102 < y < -1.7e12 or -1.7500000000000001e-14 < y < 2e6Initial program 96.3%
Taylor expanded in y around 0 64.0%
*-commutative64.0%
clear-num64.0%
un-div-inv64.0%
Applied egg-rr64.0%
associate-/r/63.6%
Simplified63.6%
Final simplification61.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.85e+112)
t
(if (<= y -1900000000000.0)
(* t (/ x z))
(if (<= y -2.1e-14) t (if (<= y 1300000.0) (* x (/ t z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.85e+112) {
tmp = t;
} else if (y <= -1900000000000.0) {
tmp = t * (x / z);
} else if (y <= -2.1e-14) {
tmp = t;
} else if (y <= 1300000.0) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.85d+112)) then
tmp = t
else if (y <= (-1900000000000.0d0)) then
tmp = t * (x / z)
else if (y <= (-2.1d-14)) then
tmp = t
else if (y <= 1300000.0d0) then
tmp = x * (t / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.85e+112) {
tmp = t;
} else if (y <= -1900000000000.0) {
tmp = t * (x / z);
} else if (y <= -2.1e-14) {
tmp = t;
} else if (y <= 1300000.0) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.85e+112: tmp = t elif y <= -1900000000000.0: tmp = t * (x / z) elif y <= -2.1e-14: tmp = t elif y <= 1300000.0: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.85e+112) tmp = t; elseif (y <= -1900000000000.0) tmp = Float64(t * Float64(x / z)); elseif (y <= -2.1e-14) tmp = t; elseif (y <= 1300000.0) tmp = Float64(x * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.85e+112) tmp = t; elseif (y <= -1900000000000.0) tmp = t * (x / z); elseif (y <= -2.1e-14) tmp = t; elseif (y <= 1300000.0) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.85e+112], t, If[LessEqual[y, -1900000000000.0], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.1e-14], t, If[LessEqual[y, 1300000.0], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{+112}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -1900000000000:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-14}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1300000:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.85000000000000002e112 or -1.9e12 < y < -2.0999999999999999e-14 or 1.3e6 < y Initial program 99.8%
associate-*l/76.3%
associate-/l*77.6%
Simplified77.6%
Taylor expanded in y around inf 60.2%
if -1.85000000000000002e112 < y < -1.9e12Initial program 99.7%
Taylor expanded in y around 0 49.2%
if -2.0999999999999999e-14 < y < 1.3e6Initial program 95.7%
Taylor expanded in y around 0 65.5%
*-commutative65.5%
clear-num65.4%
un-div-inv65.5%
Applied egg-rr65.5%
associate-/r/65.8%
Simplified65.8%
Final simplification61.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ y (- y z)))))
(if (<= y -1.08e-16)
t_1
(if (<= y 5000000.0)
(* (- x y) (/ t z))
(if (<= y 2.2e+82) (/ t (/ y (- x))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = t * (y / (y - z));
double tmp;
if (y <= -1.08e-16) {
tmp = t_1;
} else if (y <= 5000000.0) {
tmp = (x - y) * (t / z);
} else if (y <= 2.2e+82) {
tmp = t / (y / -x);
} else {
tmp = t_1;
}
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 * (y / (y - z))
if (y <= (-1.08d-16)) then
tmp = t_1
else if (y <= 5000000.0d0) then
tmp = (x - y) * (t / z)
else if (y <= 2.2d+82) then
tmp = t / (y / -x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t * (y / (y - z));
double tmp;
if (y <= -1.08e-16) {
tmp = t_1;
} else if (y <= 5000000.0) {
tmp = (x - y) * (t / z);
} else if (y <= 2.2e+82) {
tmp = t / (y / -x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (y / (y - z)) tmp = 0 if y <= -1.08e-16: tmp = t_1 elif y <= 5000000.0: tmp = (x - y) * (t / z) elif y <= 2.2e+82: tmp = t / (y / -x) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(y / Float64(y - z))) tmp = 0.0 if (y <= -1.08e-16) tmp = t_1; elseif (y <= 5000000.0) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (y <= 2.2e+82) tmp = Float64(t / Float64(y / Float64(-x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (y / (y - z)); tmp = 0.0; if (y <= -1.08e-16) tmp = t_1; elseif (y <= 5000000.0) tmp = (x - y) * (t / z); elseif (y <= 2.2e+82) tmp = t / (y / -x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.08e-16], t$95$1, If[LessEqual[y, 5000000.0], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+82], N[(t / N[(y / (-x)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{y - z}\\
\mathbf{if}\;y \leq -1.08 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5000000:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+82}:\\
\;\;\;\;\frac{t}{\frac{y}{-x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.08e-16 or 2.2000000000000001e82 < y Initial program 99.8%
Taylor expanded in x around 0 69.8%
neg-mul-169.8%
distribute-neg-frac69.8%
Simplified69.8%
*-commutative69.8%
distribute-frac-neg69.8%
distribute-frac-neg269.8%
associate-*r/55.7%
sub-neg55.7%
distribute-neg-in55.7%
remove-double-neg55.7%
Applied egg-rr55.7%
associate-/l*69.8%
+-commutative69.8%
unsub-neg69.8%
Simplified69.8%
if -1.08e-16 < y < 5e6Initial program 95.7%
associate-*l/90.5%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in z around inf 77.8%
if 5e6 < y < 2.2000000000000001e82Initial program 99.5%
associate-*l/89.2%
associate-/l*98.6%
Simplified98.6%
associate-*r/89.2%
associate-*l/99.5%
*-commutative99.5%
clear-num99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 66.3%
Taylor expanded in z around 0 57.9%
neg-mul-157.9%
distribute-neg-frac257.9%
Simplified57.9%
Final simplification73.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -9.5e+115) (not (<= y 1.55e+182))) (* (+ (/ x y) -1.0) (- t)) (* (- x y) (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9.5e+115) || !(y <= 1.55e+182)) {
tmp = ((x / y) + -1.0) * -t;
} else {
tmp = (x - y) * (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 <= (-9.5d+115)) .or. (.not. (y <= 1.55d+182))) then
tmp = ((x / y) + (-1.0d0)) * -t
else
tmp = (x - y) * (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 <= -9.5e+115) || !(y <= 1.55e+182)) {
tmp = ((x / y) + -1.0) * -t;
} else {
tmp = (x - y) * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -9.5e+115) or not (y <= 1.55e+182): tmp = ((x / y) + -1.0) * -t else: tmp = (x - y) * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -9.5e+115) || !(y <= 1.55e+182)) tmp = Float64(Float64(Float64(x / y) + -1.0) * Float64(-t)); else tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -9.5e+115) || ~((y <= 1.55e+182))) tmp = ((x / y) + -1.0) * -t; else tmp = (x - y) * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -9.5e+115], N[Not[LessEqual[y, 1.55e+182]], $MachinePrecision]], N[(N[(N[(x / y), $MachinePrecision] + -1.0), $MachinePrecision] * (-t)), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+115} \lor \neg \left(y \leq 1.55 \cdot 10^{+182}\right):\\
\;\;\;\;\left(\frac{x}{y} + -1\right) \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -9.4999999999999997e115 or 1.54999999999999998e182 < y Initial program 99.9%
Taylor expanded in z around 0 97.1%
mul-1-neg97.1%
div-sub97.1%
sub-neg97.1%
*-inverses97.1%
metadata-eval97.1%
Simplified97.1%
if -9.4999999999999997e115 < y < 1.54999999999999998e182Initial program 97.2%
associate-*l/88.9%
associate-/l*94.0%
Simplified94.0%
Final simplification94.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -6.2e-31) (not (<= x 2.45e+30))) (* t (/ x (- z y))) (* t (/ y (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6.2e-31) || !(x <= 2.45e+30)) {
tmp = t * (x / (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 ((x <= (-6.2d-31)) .or. (.not. (x <= 2.45d+30))) then
tmp = t * (x / (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 ((x <= -6.2e-31) || !(x <= 2.45e+30)) {
tmp = t * (x / (z - y));
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -6.2e-31) or not (x <= 2.45e+30): tmp = t * (x / (z - y)) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -6.2e-31) || !(x <= 2.45e+30)) tmp = Float64(t * Float64(x / 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 ((x <= -6.2e-31) || ~((x <= 2.45e+30))) tmp = t * (x / (z - y)); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -6.2e-31], N[Not[LessEqual[x, 2.45e+30]], $MachinePrecision]], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{-31} \lor \neg \left(x \leq 2.45 \cdot 10^{+30}\right):\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if x < -6.19999999999999999e-31 or 2.44999999999999992e30 < x Initial program 98.3%
Taylor expanded in x around inf 82.5%
if -6.19999999999999999e-31 < x < 2.44999999999999992e30Initial program 97.1%
Taylor expanded in x around 0 81.0%
neg-mul-181.0%
distribute-neg-frac81.0%
Simplified81.0%
*-commutative81.0%
distribute-frac-neg81.0%
distribute-frac-neg281.0%
associate-*r/67.9%
sub-neg67.9%
distribute-neg-in67.9%
remove-double-neg67.9%
Applied egg-rr67.9%
associate-/l*81.0%
+-commutative81.0%
unsub-neg81.0%
Simplified81.0%
Final simplification81.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.45e-30) (not (<= x 1.3e+33))) (/ t (/ (- z y) x)) (* t (/ y (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.45e-30) || !(x <= 1.3e+33)) {
tmp = t / ((z - y) / x);
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-1.45d-30)) .or. (.not. (x <= 1.3d+33))) then
tmp = t / ((z - y) / x)
else
tmp = t * (y / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.45e-30) || !(x <= 1.3e+33)) {
tmp = t / ((z - y) / x);
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.45e-30) or not (x <= 1.3e+33): tmp = t / ((z - y) / x) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.45e-30) || !(x <= 1.3e+33)) tmp = Float64(t / Float64(Float64(z - y) / x)); else tmp = Float64(t * Float64(y / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.45e-30) || ~((x <= 1.3e+33))) tmp = t / ((z - y) / x); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.45e-30], N[Not[LessEqual[x, 1.3e+33]], $MachinePrecision]], N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{-30} \lor \neg \left(x \leq 1.3 \cdot 10^{+33}\right):\\
\;\;\;\;\frac{t}{\frac{z - y}{x}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if x < -1.44999999999999995e-30 or 1.2999999999999999e33 < x Initial program 98.3%
associate-*l/86.7%
associate-/l*87.6%
Simplified87.6%
associate-*r/86.7%
associate-*l/98.3%
*-commutative98.3%
clear-num98.3%
un-div-inv98.4%
Applied egg-rr98.4%
Taylor expanded in x around inf 82.5%
if -1.44999999999999995e-30 < x < 1.2999999999999999e33Initial program 97.1%
Taylor expanded in x around 0 81.0%
neg-mul-181.0%
distribute-neg-frac81.0%
Simplified81.0%
*-commutative81.0%
distribute-frac-neg81.0%
distribute-frac-neg281.0%
associate-*r/67.9%
sub-neg67.9%
distribute-neg-in67.9%
remove-double-neg67.9%
Applied egg-rr67.9%
associate-/l*81.0%
+-commutative81.0%
unsub-neg81.0%
Simplified81.0%
Final simplification81.8%
(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.7%
associate-*l/85.1%
associate-/l*87.8%
Simplified87.8%
Taylor expanded in y around inf 31.4%
Final simplification31.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 2024055
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:alt
(/ t (/ (- z y) (- x y)))
(* (/ (- x y) (- z y)) t))