
(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 14 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 (let* ((t_1 (cbrt (- a z)))) (+ x (* (/ (- y z) (pow t_1 2.0)) (/ t t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = cbrt((a - z));
return x + (((y - z) / pow(t_1, 2.0)) * (t / t_1));
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.cbrt((a - z));
return x + (((y - z) / Math.pow(t_1, 2.0)) * (t / t_1));
}
function code(x, y, z, t, a) t_1 = cbrt(Float64(a - z)) return Float64(x + Float64(Float64(Float64(y - z) / (t_1 ^ 2.0)) * Float64(t / t_1))) end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Power[N[(a - z), $MachinePrecision], 1/3], $MachinePrecision]}, N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision] * N[(t / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt[3]{a - z}\\
x + \frac{y - z}{{t\_1}^{2}} \cdot \frac{t}{t\_1}
\end{array}
\end{array}
Initial program 86.3%
add-cube-cbrt86.0%
times-frac98.6%
pow298.6%
Applied egg-rr98.6%
(FPCore (x y z t a)
:precision binary64
(if (<= y -1.1e+56)
(- x (* y (/ t (- z a))))
(if (<= y 6.6e-71)
(+ x (* t (/ z (- z a))))
(+ x (* y (* t (/ -1.0 (- z a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.1e+56) {
tmp = x - (y * (t / (z - a)));
} else if (y <= 6.6e-71) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x + (y * (t * (-1.0 / (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.1d+56)) then
tmp = x - (y * (t / (z - a)))
else if (y <= 6.6d-71) then
tmp = x + (t * (z / (z - a)))
else
tmp = x + (y * (t * ((-1.0d0) / (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.1e+56) {
tmp = x - (y * (t / (z - a)));
} else if (y <= 6.6e-71) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x + (y * (t * (-1.0 / (z - a))));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.1e+56: tmp = x - (y * (t / (z - a))) elif y <= 6.6e-71: tmp = x + (t * (z / (z - a))) else: tmp = x + (y * (t * (-1.0 / (z - a)))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.1e+56) tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); elseif (y <= 6.6e-71) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(y * Float64(t * Float64(-1.0 / Float64(z - a))))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.1e+56) tmp = x - (y * (t / (z - a))); elseif (y <= 6.6e-71) tmp = x + (t * (z / (z - a))); else tmp = x + (y * (t * (-1.0 / (z - a)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.1e+56], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e-71], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t * N[(-1.0 / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+56}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{-71}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t \cdot \frac{-1}{z - a}\right)\\
\end{array}
\end{array}
if y < -1.10000000000000008e56Initial program 77.6%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in y around inf 96.0%
if -1.10000000000000008e56 < y < 6.6000000000000003e-71Initial program 88.0%
add-cube-cbrt87.7%
times-frac99.3%
pow299.3%
Applied egg-rr99.3%
clear-num99.4%
frac-times98.6%
*-un-lft-identity98.6%
Applied egg-rr98.6%
associate-*l/98.6%
unpow298.6%
rem-3cbrt-lft99.2%
Simplified99.2%
Taylor expanded in y around 0 81.8%
mul-1-neg81.8%
unsub-neg81.8%
associate-/l*93.0%
Simplified93.0%
if 6.6000000000000003e-71 < y Initial program 89.3%
associate-/l*98.7%
Simplified98.7%
clear-num98.7%
associate-/r/98.7%
Applied egg-rr98.7%
Taylor expanded in y around inf 91.3%
Final simplification93.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ t (- z a))))
(if (or (<= y -3.9e-110) (not (<= y 1.05e-70)))
(- x (* y t_1))
(+ x (* z t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t / (z - a);
double tmp;
if ((y <= -3.9e-110) || !(y <= 1.05e-70)) {
tmp = x - (y * t_1);
} else {
tmp = x + (z * 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 = t / (z - a)
if ((y <= (-3.9d-110)) .or. (.not. (y <= 1.05d-70))) then
tmp = x - (y * t_1)
else
tmp = x + (z * 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 = t / (z - a);
double tmp;
if ((y <= -3.9e-110) || !(y <= 1.05e-70)) {
tmp = x - (y * t_1);
} else {
tmp = x + (z * t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t / (z - a) tmp = 0 if (y <= -3.9e-110) or not (y <= 1.05e-70): tmp = x - (y * t_1) else: tmp = x + (z * t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(t / Float64(z - a)) tmp = 0.0 if ((y <= -3.9e-110) || !(y <= 1.05e-70)) tmp = Float64(x - Float64(y * t_1)); else tmp = Float64(x + Float64(z * t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t / (z - a); tmp = 0.0; if ((y <= -3.9e-110) || ~((y <= 1.05e-70))) tmp = x - (y * t_1); else tmp = x + (z * t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y, -3.9e-110], N[Not[LessEqual[y, 1.05e-70]], $MachinePrecision]], N[(x - N[(y * t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{z - a}\\
\mathbf{if}\;y \leq -3.9 \cdot 10^{-110} \lor \neg \left(y \leq 1.05 \cdot 10^{-70}\right):\\
\;\;\;\;x - y \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot t\_1\\
\end{array}
\end{array}
if y < -3.9e-110 or 1.0500000000000001e-70 < y Initial program 85.6%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in y around inf 90.5%
if -3.9e-110 < y < 1.0500000000000001e-70Initial program 87.6%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in y around 0 84.4%
associate-*r/84.4%
mul-1-neg84.4%
distribute-rgt-neg-out84.4%
associate-*l/94.6%
*-commutative94.6%
distribute-lft-neg-out94.6%
distribute-rgt-neg-in94.6%
distribute-frac-neg294.6%
neg-sub094.6%
sub-neg94.6%
+-commutative94.6%
associate--r+94.6%
neg-sub094.6%
remove-double-neg94.6%
Simplified94.6%
Final simplification92.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.5e+56) (- x (* y (/ t (- z a)))) (if (<= y 5.2e-68) (+ x (* t (/ z (- z a)))) (+ x (/ y (/ (- a z) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.5e+56) {
tmp = x - (y * (t / (z - a)));
} else if (y <= 5.2e-68) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x + (y / ((a - z) / 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 (y <= (-3.5d+56)) then
tmp = x - (y * (t / (z - a)))
else if (y <= 5.2d-68) then
tmp = x + (t * (z / (z - a)))
else
tmp = x + (y / ((a - z) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.5e+56) {
tmp = x - (y * (t / (z - a)));
} else if (y <= 5.2e-68) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.5e+56: tmp = x - (y * (t / (z - a))) elif y <= 5.2e-68: tmp = x + (t * (z / (z - a))) else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.5e+56) tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); elseif (y <= 5.2e-68) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3.5e+56) tmp = x - (y * (t / (z - a))); elseif (y <= 5.2e-68) tmp = x + (t * (z / (z - a))); else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.5e+56], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e-68], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+56}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-68}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if y < -3.49999999999999999e56Initial program 77.6%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in y around inf 96.0%
if -3.49999999999999999e56 < y < 5.1999999999999996e-68Initial program 88.0%
add-cube-cbrt87.7%
times-frac99.3%
pow299.3%
Applied egg-rr99.3%
clear-num99.4%
frac-times98.6%
*-un-lft-identity98.6%
Applied egg-rr98.6%
associate-*l/98.6%
unpow298.6%
rem-3cbrt-lft99.2%
Simplified99.2%
Taylor expanded in y around 0 81.8%
mul-1-neg81.8%
unsub-neg81.8%
associate-/l*93.0%
Simplified93.0%
if 5.1999999999999996e-68 < y Initial program 89.3%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in y around inf 91.3%
clear-num91.3%
un-div-inv91.3%
Applied egg-rr91.3%
Final simplification93.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ t (- z a))))
(if (<= y -3.7e-110)
(- x (* y t_1))
(if (<= y 3.6e-68) (+ x (* z t_1)) (+ x (/ y (/ (- a z) t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t / (z - a);
double tmp;
if (y <= -3.7e-110) {
tmp = x - (y * t_1);
} else if (y <= 3.6e-68) {
tmp = x + (z * t_1);
} else {
tmp = x + (y / ((a - z) / 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) :: t_1
real(8) :: tmp
t_1 = t / (z - a)
if (y <= (-3.7d-110)) then
tmp = x - (y * t_1)
else if (y <= 3.6d-68) then
tmp = x + (z * t_1)
else
tmp = x + (y / ((a - z) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t / (z - a);
double tmp;
if (y <= -3.7e-110) {
tmp = x - (y * t_1);
} else if (y <= 3.6e-68) {
tmp = x + (z * t_1);
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t / (z - a) tmp = 0 if y <= -3.7e-110: tmp = x - (y * t_1) elif y <= 3.6e-68: tmp = x + (z * t_1) else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) t_1 = Float64(t / Float64(z - a)) tmp = 0.0 if (y <= -3.7e-110) tmp = Float64(x - Float64(y * t_1)); elseif (y <= 3.6e-68) tmp = Float64(x + Float64(z * t_1)); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t / (z - a); tmp = 0.0; if (y <= -3.7e-110) tmp = x - (y * t_1); elseif (y <= 3.6e-68) tmp = x + (z * t_1); else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.7e-110], N[(x - N[(y * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.6e-68], N[(x + N[(z * t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{z - a}\\
\mathbf{if}\;y \leq -3.7 \cdot 10^{-110}:\\
\;\;\;\;x - y \cdot t\_1\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{-68}:\\
\;\;\;\;x + z \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if y < -3.70000000000000016e-110Initial program 82.3%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in y around inf 89.8%
if -3.70000000000000016e-110 < y < 3.60000000000000007e-68Initial program 87.6%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in y around 0 84.4%
associate-*r/84.4%
mul-1-neg84.4%
distribute-rgt-neg-out84.4%
associate-*l/94.6%
*-commutative94.6%
distribute-lft-neg-out94.6%
distribute-rgt-neg-in94.6%
distribute-frac-neg294.6%
neg-sub094.6%
sub-neg94.6%
+-commutative94.6%
associate--r+94.6%
neg-sub094.6%
remove-double-neg94.6%
Simplified94.6%
if 3.60000000000000007e-68 < y Initial program 89.3%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in y around inf 91.3%
clear-num91.3%
un-div-inv91.3%
Applied egg-rr91.3%
Final simplification92.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.8e-20) (not (<= z 1.3e-16))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.8e-20) || !(z <= 1.3e-16)) {
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 <= (-3.8d-20)) .or. (.not. (z <= 1.3d-16))) 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 <= -3.8e-20) || !(z <= 1.3e-16)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.8e-20) or not (z <= 1.3e-16): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.8e-20) || !(z <= 1.3e-16)) 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 <= -3.8e-20) || ~((z <= 1.3e-16))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.8e-20], N[Not[LessEqual[z, 1.3e-16]], $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 -3.8 \cdot 10^{-20} \lor \neg \left(z \leq 1.3 \cdot 10^{-16}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3.7999999999999998e-20 or 1.2999999999999999e-16 < z Initial program 77.6%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around inf 75.9%
if -3.7999999999999998e-20 < z < 1.2999999999999999e-16Initial program 95.4%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in y around inf 95.9%
Taylor expanded in a around inf 83.4%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e-20) (not (<= z 2.6e-11))) (+ x t) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e-20) || !(z <= 2.6e-11)) {
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 <= (-4.8d-20)) .or. (.not. (z <= 2.6d-11))) 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 <= -4.8e-20) || !(z <= 2.6e-11)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.8e-20) or not (z <= 2.6e-11): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.8e-20) || !(z <= 2.6e-11)) 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 <= -4.8e-20) || ~((z <= 2.6e-11))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.8e-20], N[Not[LessEqual[z, 2.6e-11]], $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 -4.8 \cdot 10^{-20} \lor \neg \left(z \leq 2.6 \cdot 10^{-11}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -4.79999999999999986e-20 or 2.6000000000000001e-11 < z Initial program 77.6%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around inf 75.9%
if -4.79999999999999986e-20 < z < 2.6000000000000001e-11Initial program 95.4%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around 0 81.0%
associate-/l*83.2%
Simplified83.2%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.9e-20) (+ x t) (if (<= z 1.86e-59) (+ x (* y (/ t a))) (- x (* y (/ t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.9e-20) {
tmp = x + t;
} else if (z <= 1.86e-59) {
tmp = x + (y * (t / a));
} else {
tmp = x - (y * (t / 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 (z <= (-4.9d-20)) then
tmp = x + t
else if (z <= 1.86d-59) then
tmp = x + (y * (t / a))
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 a) {
double tmp;
if (z <= -4.9e-20) {
tmp = x + t;
} else if (z <= 1.86e-59) {
tmp = x + (y * (t / a));
} else {
tmp = x - (y * (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.9e-20: tmp = x + t elif z <= 1.86e-59: tmp = x + (y * (t / a)) else: tmp = x - (y * (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.9e-20) tmp = Float64(x + t); elseif (z <= 1.86e-59) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x - Float64(y * Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.9e-20) tmp = x + t; elseif (z <= 1.86e-59) tmp = x + (y * (t / a)); else tmp = x - (y * (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.9e-20], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.86e-59], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.9 \cdot 10^{-20}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.86 \cdot 10^{-59}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\end{array}
\end{array}
if z < -4.9000000000000002e-20Initial program 73.0%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in z around inf 77.1%
if -4.9000000000000002e-20 < z < 1.86000000000000004e-59Initial program 95.7%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in y around inf 96.3%
Taylor expanded in a around inf 84.1%
if 1.86000000000000004e-59 < z Initial program 84.4%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in y around inf 79.1%
Taylor expanded in a around 0 75.0%
associate-*r/75.0%
neg-mul-175.0%
Simplified75.0%
*-commutative75.0%
add-sqr-sqrt34.4%
sqrt-unprod60.5%
sqr-neg60.5%
sqrt-unprod31.1%
add-sqr-sqrt58.5%
cancel-sign-sub58.5%
distribute-frac-neg58.5%
*-commutative58.5%
add-sqr-sqrt27.4%
sqrt-unprod65.5%
sqr-neg65.5%
sqrt-unprod40.7%
add-sqr-sqrt75.0%
Applied egg-rr75.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.45e+58) (+ x t) (- x (* y (/ t (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.45e+58) {
tmp = x + t;
} else {
tmp = x - (y * (t / (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 (z <= (-1.45d+58)) then
tmp = x + t
else
tmp = x - (y * (t / (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 (z <= -1.45e+58) {
tmp = x + t;
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.45e+58: tmp = x + t else: tmp = x - (y * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.45e+58) tmp = Float64(x + t); else tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.45e+58) tmp = x + t; else tmp = x - (y * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.45e+58], N[(x + t), $MachinePrecision], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+58}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if z < -1.45000000000000001e58Initial program 61.1%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in z around inf 85.8%
if -1.45000000000000001e58 < z Initial program 91.9%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in y around inf 88.2%
Final simplification87.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.5e-20) (not (<= z 36.0))) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.5e-20) || !(z <= 36.0)) {
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 <= (-2.5d-20)) .or. (.not. (z <= 36.0d0))) 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 <= -2.5e-20) || !(z <= 36.0)) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.5e-20) or not (z <= 36.0): tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.5e-20) || !(z <= 36.0)) 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 <= -2.5e-20) || ~((z <= 36.0))) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.5e-20], N[Not[LessEqual[z, 36.0]], $MachinePrecision]], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-20} \lor \neg \left(z \leq 36\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.4999999999999999e-20 or 36 < z Initial program 77.1%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around inf 76.1%
if -2.4999999999999999e-20 < z < 36Initial program 95.5%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in x around inf 61.6%
Final simplification68.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -3.3e-262) x (if (<= x 2.7e-94) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -3.3e-262) {
tmp = x;
} else if (x <= 2.7e-94) {
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 <= (-3.3d-262)) then
tmp = x
else if (x <= 2.7d-94) 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 <= -3.3e-262) {
tmp = x;
} else if (x <= 2.7e-94) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -3.3e-262: tmp = x elif x <= 2.7e-94: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -3.3e-262) tmp = x; elseif (x <= 2.7e-94) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -3.3e-262) tmp = x; elseif (x <= 2.7e-94) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -3.3e-262], x, If[LessEqual[x, 2.7e-94], t, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.3 \cdot 10^{-262}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-94}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.3000000000000003e-262 or 2.7000000000000001e-94 < x Initial program 87.2%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in x around inf 68.7%
if -3.3000000000000003e-262 < x < 2.7000000000000001e-94Initial program 82.7%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in a around 0 51.1%
mul-1-neg51.1%
unsub-neg51.1%
associate-/l*62.3%
Simplified62.3%
Taylor expanded in t around inf 59.2%
Taylor expanded in y around 0 33.9%
(FPCore (x y z t a) :precision binary64 (+ x (/ t (/ (- a z) (- y z)))))
double code(double x, double y, double z, double t, double a) {
return x + (t / ((a - z) / (y - 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 + (t / ((a - z) / (y - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t / ((a - z) / (y - z)));
}
def code(x, y, z, t, a): return x + (t / ((a - z) / (y - z)))
function code(x, y, z, t, a) return Float64(x + Float64(t / Float64(Float64(a - z) / Float64(y - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + (t / ((a - z) / (y - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{t}{\frac{a - z}{y - z}}
\end{array}
Initial program 86.3%
add-cube-cbrt86.0%
times-frac98.6%
pow298.6%
Applied egg-rr98.6%
clear-num98.6%
frac-times97.7%
*-un-lft-identity97.7%
Applied egg-rr97.7%
associate-*l/97.7%
unpow297.7%
rem-3cbrt-lft98.3%
Simplified98.3%
(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 86.3%
associate-/l*97.7%
Simplified97.7%
(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 86.3%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in a around 0 60.4%
mul-1-neg60.4%
unsub-neg60.4%
associate-/l*67.4%
Simplified67.4%
Taylor expanded in t around inf 27.1%
Taylor expanded in y around 0 14.7%
(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 2024170
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (if (< t -10682974490174067/10000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 312887599100691/80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t)))))
(+ x (/ (* (- y z) t) (- a z))))