
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ (- y z) (/ (- a z) t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) / ((a - z) / t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y - z) / ((a - z) / t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) / ((a - z) / t));
}
def code(x, y, z, t, a): return x + ((y - z) / ((a - z) / t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) / ((a - z) / t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - z}{\frac{a - z}{t}}
\end{array}
Initial program 87.1%
associate-/l*96.9%
Simplified96.9%
clear-num96.9%
un-div-inv96.9%
Applied egg-rr96.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.06e+92)
(+ x t)
(if (<= z -6.8e-87)
(- x (* t (/ y z)))
(if (<= z -2.9e-94)
(+ x (/ (* y t) a))
(if (<= z 9e+18) (+ x (* y (/ t a))) (+ x t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.06e+92) {
tmp = x + t;
} else if (z <= -6.8e-87) {
tmp = x - (t * (y / z));
} else if (z <= -2.9e-94) {
tmp = x + ((y * t) / a);
} else if (z <= 9e+18) {
tmp = x + (y * (t / a));
} else {
tmp = x + t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.06d+92)) then
tmp = x + t
else if (z <= (-6.8d-87)) then
tmp = x - (t * (y / z))
else if (z <= (-2.9d-94)) then
tmp = x + ((y * t) / a)
else if (z <= 9d+18) then
tmp = x + (y * (t / a))
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.06e+92) {
tmp = x + t;
} else if (z <= -6.8e-87) {
tmp = x - (t * (y / z));
} else if (z <= -2.9e-94) {
tmp = x + ((y * t) / a);
} else if (z <= 9e+18) {
tmp = x + (y * (t / a));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.06e+92: tmp = x + t elif z <= -6.8e-87: tmp = x - (t * (y / z)) elif z <= -2.9e-94: tmp = x + ((y * t) / a) elif z <= 9e+18: tmp = x + (y * (t / a)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.06e+92) tmp = Float64(x + t); elseif (z <= -6.8e-87) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= -2.9e-94) tmp = Float64(x + Float64(Float64(y * t) / a)); elseif (z <= 9e+18) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.06e+92) tmp = x + t; elseif (z <= -6.8e-87) tmp = x - (t * (y / z)); elseif (z <= -2.9e-94) tmp = x + ((y * t) / a); elseif (z <= 9e+18) tmp = x + (y * (t / a)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.06e+92], N[(x + t), $MachinePrecision], If[LessEqual[z, -6.8e-87], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.9e-94], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+18], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.06 \cdot 10^{+92}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-87}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-94}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+18}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.05999999999999999e92 or 9e18 < z Initial program 73.9%
associate-/l*95.5%
Simplified95.5%
Taylor expanded in z around inf 83.2%
if -1.05999999999999999e92 < z < -6.7999999999999997e-87Initial program 97.2%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in a around 0 62.9%
mul-1-neg62.9%
unsub-neg62.9%
associate-/l*65.6%
Simplified65.6%
Taylor expanded in y around inf 60.3%
associate-/l*62.9%
Simplified62.9%
if -6.7999999999999997e-87 < z < -2.89999999999999995e-94Initial program 100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 76.5%
+-commutative76.5%
Simplified76.5%
if -2.89999999999999995e-94 < z < 9e18Initial program 96.5%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around 0 77.2%
+-commutative77.2%
Simplified77.2%
clear-num77.1%
associate-/r*78.2%
associate-/r/78.2%
clear-num78.2%
Applied egg-rr78.2%
Final simplification78.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -0.135) (not (<= y 2.6e-7))) (+ x (* y (/ t (- a z)))) (+ x (/ t (- 1.0 (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -0.135) || !(y <= 2.6e-7)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (t / (1.0 - (a / z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-0.135d0)) .or. (.not. (y <= 2.6d-7))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (t / (1.0d0 - (a / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -0.135) || !(y <= 2.6e-7)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (t / (1.0 - (a / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -0.135) or not (y <= 2.6e-7): tmp = x + (y * (t / (a - z))) else: tmp = x + (t / (1.0 - (a / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -0.135) || !(y <= 2.6e-7)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(t / Float64(1.0 - Float64(a / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -0.135) || ~((y <= 2.6e-7))) tmp = x + (y * (t / (a - z))); else tmp = x + (t / (1.0 - (a / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -0.135], N[Not[LessEqual[y, 2.6e-7]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.135 \lor \neg \left(y \leq 2.6 \cdot 10^{-7}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{1 - \frac{a}{z}}\\
\end{array}
\end{array}
if y < -0.13500000000000001 or 2.59999999999999999e-7 < y Initial program 86.3%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in y around inf 92.0%
if -0.13500000000000001 < y < 2.59999999999999999e-7Initial program 87.9%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in y around 0 84.2%
mul-1-neg84.2%
associate-/l*96.2%
distribute-rgt-neg-in96.2%
distribute-neg-frac296.2%
neg-sub096.2%
sub-neg96.2%
+-commutative96.2%
associate--r+96.2%
neg-sub096.2%
remove-double-neg96.2%
Simplified96.2%
+-commutative96.2%
*-un-lft-identity96.2%
fma-define96.2%
clear-num96.2%
un-div-inv96.2%
div-sub96.2%
*-inverses96.2%
Applied egg-rr96.2%
fma-undefine96.2%
*-lft-identity96.2%
Simplified96.2%
Final simplification94.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -0.102) (not (<= y 3.2e-7))) (+ x (* y (/ t (- a z)))) (+ x (* t (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -0.102) || !(y <= 3.2e-7)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (t * (z / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-0.102d0)) .or. (.not. (y <= 3.2d-7))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (t * (z / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -0.102) || !(y <= 3.2e-7)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (t * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -0.102) or not (y <= 3.2e-7): tmp = x + (y * (t / (a - z))) else: tmp = x + (t * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -0.102) || !(y <= 3.2e-7)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -0.102) || ~((y <= 3.2e-7))) tmp = x + (y * (t / (a - z))); else tmp = x + (t * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -0.102], N[Not[LessEqual[y, 3.2e-7]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.102 \lor \neg \left(y \leq 3.2 \cdot 10^{-7}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if y < -0.101999999999999993 or 3.2000000000000001e-7 < y Initial program 86.3%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in y around inf 92.0%
if -0.101999999999999993 < y < 3.2000000000000001e-7Initial program 87.9%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in y around 0 84.2%
mul-1-neg84.2%
associate-/l*96.2%
distribute-rgt-neg-in96.2%
distribute-neg-frac296.2%
neg-sub096.2%
sub-neg96.2%
+-commutative96.2%
associate--r+96.2%
neg-sub096.2%
remove-double-neg96.2%
Simplified96.2%
Final simplification94.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.55e+68) (not (<= y 7.8e+59))) (+ x (* y (/ t a))) (+ x (* t (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.55e+68) || !(y <= 7.8e+59)) {
tmp = x + (y * (t / a));
} else {
tmp = x + (t * (z / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-1.55d+68)) .or. (.not. (y <= 7.8d+59))) then
tmp = x + (y * (t / a))
else
tmp = x + (t * (z / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.55e+68) || !(y <= 7.8e+59)) {
tmp = x + (y * (t / a));
} else {
tmp = x + (t * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.55e+68) or not (y <= 7.8e+59): tmp = x + (y * (t / a)) else: tmp = x + (t * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.55e+68) || !(y <= 7.8e+59)) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.55e+68) || ~((y <= 7.8e+59))) tmp = x + (y * (t / a)); else tmp = x + (t * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.55e+68], N[Not[LessEqual[y, 7.8e+59]], $MachinePrecision]], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+68} \lor \neg \left(y \leq 7.8 \cdot 10^{+59}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if y < -1.5499999999999999e68 or 7.80000000000000043e59 < y Initial program 85.9%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in z around 0 66.9%
+-commutative66.9%
Simplified66.9%
clear-num66.9%
associate-/r*71.3%
associate-/r/71.3%
clear-num71.3%
Applied egg-rr71.3%
if -1.5499999999999999e68 < y < 7.80000000000000043e59Initial program 87.9%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in y around 0 79.6%
mul-1-neg79.6%
associate-/l*91.6%
distribute-rgt-neg-in91.6%
distribute-neg-frac291.6%
neg-sub091.6%
sub-neg91.6%
+-commutative91.6%
associate--r+91.6%
neg-sub091.6%
remove-double-neg91.6%
Simplified91.6%
Final simplification83.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4e-62) (not (<= z 5.8e+19))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4e-62) || !(z <= 5.8e+19)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-4d-62)) .or. (.not. (z <= 5.8d+19))) then
tmp = x + t
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4e-62) || !(z <= 5.8e+19)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4e-62) or not (z <= 5.8e+19): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4e-62) || !(z <= 5.8e+19)) tmp = Float64(x + t); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4e-62) || ~((z <= 5.8e+19))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4e-62], N[Not[LessEqual[z, 5.8e+19]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-62} \lor \neg \left(z \leq 5.8 \cdot 10^{+19}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -4.0000000000000002e-62 or 5.8e19 < z Initial program 78.5%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around inf 76.6%
if -4.0000000000000002e-62 < z < 5.8e19Initial program 96.8%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in z around 0 76.5%
+-commutative76.5%
Simplified76.5%
clear-num76.5%
associate-/r*76.7%
associate-/r/76.7%
clear-num76.7%
Applied egg-rr76.7%
Final simplification76.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e-63) (not (<= z 1e+19))) (+ x t) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e-63) || !(z <= 1e+19)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.1d-63)) .or. (.not. (z <= 1d+19))) then
tmp = x + t
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e-63) || !(z <= 1e+19)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.1e-63) or not (z <= 1e+19): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e-63) || !(z <= 1e+19)) tmp = Float64(x + t); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.1e-63) || ~((z <= 1e+19))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.1e-63], N[Not[LessEqual[z, 1e+19]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-63} \lor \neg \left(z \leq 10^{+19}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.1e-63 or 1e19 < z Initial program 78.5%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around inf 76.6%
if -1.1e-63 < z < 1e19Initial program 96.8%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in z around 0 76.5%
associate-/l*75.6%
Simplified75.6%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4e+103) (not (<= t 1.05e+240))) (* t (- 1.0 (/ y z))) (+ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4e+103) || !(t <= 1.05e+240)) {
tmp = t * (1.0 - (y / z));
} else {
tmp = x + t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4d+103)) .or. (.not. (t <= 1.05d+240))) then
tmp = t * (1.0d0 - (y / z))
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4e+103) || !(t <= 1.05e+240)) {
tmp = t * (1.0 - (y / z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4e+103) or not (t <= 1.05e+240): tmp = t * (1.0 - (y / z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4e+103) || !(t <= 1.05e+240)) tmp = Float64(t * Float64(1.0 - Float64(y / z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4e+103) || ~((t <= 1.05e+240))) tmp = t * (1.0 - (y / z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4e+103], N[Not[LessEqual[t, 1.05e+240]], $MachinePrecision]], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{+103} \lor \neg \left(t \leq 1.05 \cdot 10^{+240}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if t < -4e103 or 1.0499999999999999e240 < t Initial program 64.8%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in a around 0 35.3%
mul-1-neg35.3%
unsub-neg35.3%
associate-/l*60.5%
Simplified60.5%
Taylor expanded in t around inf 58.2%
if -4e103 < t < 1.0499999999999999e240Initial program 94.1%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in z around inf 66.7%
Final simplification64.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.4e+41) (not (<= z 7.8e-79))) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.4e+41) || !(z <= 7.8e-79)) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.4d+41)) .or. (.not. (z <= 7.8d-79))) then
tmp = x + t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.4e+41) || !(z <= 7.8e-79)) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.4e+41) or not (z <= 7.8e-79): tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.4e+41) || !(z <= 7.8e-79)) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.4e+41) || ~((z <= 7.8e-79))) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.4e+41], N[Not[LessEqual[z, 7.8e-79]], $MachinePrecision]], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+41} \lor \neg \left(z \leq 7.8 \cdot 10^{-79}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.4e41 or 7.80000000000000011e-79 < z Initial program 79.7%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in z around inf 74.6%
if -1.4e41 < z < 7.80000000000000011e-79Initial program 96.6%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in x around inf 47.5%
Final simplification62.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -2.6e-157) x (if (<= x 1.7e-197) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.6e-157) {
tmp = x;
} else if (x <= 1.7e-197) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-2.6d-157)) then
tmp = x
else if (x <= 1.7d-197) then
tmp = t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.6e-157) {
tmp = x;
} else if (x <= 1.7e-197) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.6e-157: tmp = x elif x <= 1.7e-197: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.6e-157) tmp = x; elseif (x <= 1.7e-197) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -2.6e-157) tmp = x; elseif (x <= 1.7e-197) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.6e-157], x, If[LessEqual[x, 1.7e-197], t, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-157}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-197}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.59999999999999988e-157 or 1.6999999999999999e-197 < x Initial program 89.2%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in x around inf 58.9%
if -2.59999999999999988e-157 < x < 1.6999999999999999e-197Initial program 79.4%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in a around 0 45.2%
mul-1-neg45.2%
unsub-neg45.2%
associate-/l*59.9%
Simplified59.9%
Taylor expanded in t around inf 53.3%
Taylor expanded in y around 0 38.0%
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ t (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (t / (a - z)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y - z) * (t / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (t / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * (t / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * (t / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t}{a - z}
\end{array}
Initial program 87.1%
associate-/l*96.9%
Simplified96.9%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 87.1%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in a around 0 59.4%
mul-1-neg59.4%
unsub-neg59.4%
associate-/l*66.8%
Simplified66.8%
Taylor expanded in t around inf 32.3%
Taylor expanded in y around 0 19.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (((y - z) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (a - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024110
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))