
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\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 t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- t a) (- t z)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((t - a) / (t - 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 / ((t - a) / (t - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((t - a) / (t - z)));
}
def code(x, y, z, t, a): return x + (y / ((t - a) / (t - z)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(t - a) / Float64(t - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((t - a) / (t - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{t - a}{t - z}}
\end{array}
Initial program 98.5%
clear-num98.4%
un-div-inv98.6%
Applied egg-rr98.6%
Final simplification98.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3e+15)
(+ x y)
(if (<= t 1.8e-98)
(- x (* z (* y (/ -1.0 a))))
(if (<= t 3.6e+171) (- x (* z (/ y t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3e+15) {
tmp = x + y;
} else if (t <= 1.8e-98) {
tmp = x - (z * (y * (-1.0 / a)));
} else if (t <= 3.6e+171) {
tmp = x - (z * (y / t));
} else {
tmp = x + y;
}
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 <= (-3d+15)) then
tmp = x + y
else if (t <= 1.8d-98) then
tmp = x - (z * (y * ((-1.0d0) / a)))
else if (t <= 3.6d+171) then
tmp = x - (z * (y / t))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3e+15) {
tmp = x + y;
} else if (t <= 1.8e-98) {
tmp = x - (z * (y * (-1.0 / a)));
} else if (t <= 3.6e+171) {
tmp = x - (z * (y / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3e+15: tmp = x + y elif t <= 1.8e-98: tmp = x - (z * (y * (-1.0 / a))) elif t <= 3.6e+171: tmp = x - (z * (y / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3e+15) tmp = Float64(x + y); elseif (t <= 1.8e-98) tmp = Float64(x - Float64(z * Float64(y * Float64(-1.0 / a)))); elseif (t <= 3.6e+171) tmp = Float64(x - Float64(z * Float64(y / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3e+15) tmp = x + y; elseif (t <= 1.8e-98) tmp = x - (z * (y * (-1.0 / a))); elseif (t <= 3.6e+171) tmp = x - (z * (y / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3e+15], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.8e-98], N[(x - N[(z * N[(y * N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.6e+171], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{+15}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-98}:\\
\;\;\;\;x - z \cdot \left(y \cdot \frac{-1}{a}\right)\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{+171}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3e15 or 3.60000000000000018e171 < t Initial program 99.9%
Taylor expanded in t around inf 87.9%
+-commutative87.9%
Simplified87.9%
if -3e15 < t < 1.8000000000000001e-98Initial program 96.4%
Taylor expanded in t around 0 80.0%
div-inv80.0%
*-commutative80.0%
associate-*l*83.7%
Applied egg-rr83.7%
if 1.8000000000000001e-98 < t < 3.60000000000000018e171Initial program 99.9%
Taylor expanded in a around 0 77.6%
mul-1-neg77.6%
unsub-neg77.6%
associate-/l*83.3%
div-sub83.3%
sub-neg83.3%
*-inverses83.3%
metadata-eval83.3%
Simplified83.3%
Taylor expanded in z around inf 71.6%
*-commutative71.6%
associate-/l*75.9%
Applied egg-rr75.9%
Final simplification83.2%
(FPCore (x y z t a)
:precision binary64
(if (<= t -7.6e+18)
(+ x y)
(if (<= t 1.55e-98)
(+ x (/ y (/ a z)))
(if (<= t 3.5e+171) (- x (* z (/ y t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.6e+18) {
tmp = x + y;
} else if (t <= 1.55e-98) {
tmp = x + (y / (a / z));
} else if (t <= 3.5e+171) {
tmp = x - (z * (y / t));
} else {
tmp = x + y;
}
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 <= (-7.6d+18)) then
tmp = x + y
else if (t <= 1.55d-98) then
tmp = x + (y / (a / z))
else if (t <= 3.5d+171) then
tmp = x - (z * (y / t))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.6e+18) {
tmp = x + y;
} else if (t <= 1.55e-98) {
tmp = x + (y / (a / z));
} else if (t <= 3.5e+171) {
tmp = x - (z * (y / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.6e+18: tmp = x + y elif t <= 1.55e-98: tmp = x + (y / (a / z)) elif t <= 3.5e+171: tmp = x - (z * (y / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.6e+18) tmp = Float64(x + y); elseif (t <= 1.55e-98) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 3.5e+171) tmp = Float64(x - Float64(z * Float64(y / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7.6e+18) tmp = x + y; elseif (t <= 1.55e-98) tmp = x + (y / (a / z)); elseif (t <= 3.5e+171) tmp = x - (z * (y / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.6e+18], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.55e-98], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e+171], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.6 \cdot 10^{+18}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-98}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+171}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -7.6e18 or 3.4999999999999999e171 < t Initial program 99.9%
Taylor expanded in t around inf 87.9%
+-commutative87.9%
Simplified87.9%
if -7.6e18 < t < 1.55e-98Initial program 96.4%
clear-num96.2%
un-div-inv96.6%
Applied egg-rr96.6%
Taylor expanded in t around 0 83.1%
if 1.55e-98 < t < 3.4999999999999999e171Initial program 99.9%
Taylor expanded in a around 0 77.6%
mul-1-neg77.6%
unsub-neg77.6%
associate-/l*83.3%
div-sub83.3%
sub-neg83.3%
*-inverses83.3%
metadata-eval83.3%
Simplified83.3%
Taylor expanded in z around inf 71.6%
*-commutative71.6%
associate-/l*75.9%
Applied egg-rr75.9%
Final simplification83.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.95e+16)
(+ x y)
(if (<= t 1.55e-98)
(+ x (/ y (/ a z)))
(if (<= t 6800.0) (- x (* y (/ z t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.95e+16) {
tmp = x + y;
} else if (t <= 1.55e-98) {
tmp = x + (y / (a / z));
} else if (t <= 6800.0) {
tmp = x - (y * (z / t));
} else {
tmp = x + y;
}
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 <= (-1.95d+16)) then
tmp = x + y
else if (t <= 1.55d-98) then
tmp = x + (y / (a / z))
else if (t <= 6800.0d0) then
tmp = x - (y * (z / t))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.95e+16) {
tmp = x + y;
} else if (t <= 1.55e-98) {
tmp = x + (y / (a / z));
} else if (t <= 6800.0) {
tmp = x - (y * (z / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.95e+16: tmp = x + y elif t <= 1.55e-98: tmp = x + (y / (a / z)) elif t <= 6800.0: tmp = x - (y * (z / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.95e+16) tmp = Float64(x + y); elseif (t <= 1.55e-98) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 6800.0) tmp = Float64(x - Float64(y * Float64(z / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.95e+16) tmp = x + y; elseif (t <= 1.55e-98) tmp = x + (y / (a / z)); elseif (t <= 6800.0) tmp = x - (y * (z / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.95e+16], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.55e-98], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6800.0], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{+16}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-98}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 6800:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.95e16 or 6800 < t Initial program 99.9%
Taylor expanded in t around inf 81.7%
+-commutative81.7%
Simplified81.7%
if -1.95e16 < t < 1.55e-98Initial program 96.4%
clear-num96.2%
un-div-inv96.6%
Applied egg-rr96.6%
Taylor expanded in t around 0 83.1%
if 1.55e-98 < t < 6800Initial program 99.9%
Taylor expanded in z around inf 96.4%
Taylor expanded in a around 0 87.1%
mul-1-neg87.1%
associate-/l*87.1%
*-commutative87.1%
unsub-neg87.1%
*-commutative87.1%
Simplified87.1%
Final simplification82.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7.5e+54) (not (<= t 9e+61))) (+ x (/ y (/ t (- t z)))) (+ x (/ (* y z) (- a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.5e+54) || !(t <= 9e+61)) {
tmp = x + (y / (t / (t - z)));
} else {
tmp = x + ((y * z) / (a - 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 <= (-7.5d+54)) .or. (.not. (t <= 9d+61))) then
tmp = x + (y / (t / (t - z)))
else
tmp = x + ((y * z) / (a - 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 <= -7.5e+54) || !(t <= 9e+61)) {
tmp = x + (y / (t / (t - z)));
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7.5e+54) or not (t <= 9e+61): tmp = x + (y / (t / (t - z))) else: tmp = x + ((y * z) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.5e+54) || !(t <= 9e+61)) tmp = Float64(x + Float64(y / Float64(t / Float64(t - z)))); else tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7.5e+54) || ~((t <= 9e+61))) tmp = x + (y / (t / (t - z))); else tmp = x + ((y * z) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.5e+54], N[Not[LessEqual[t, 9e+61]], $MachinePrecision]], N[(x + N[(y / N[(t / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{+54} \lor \neg \left(t \leq 9 \cdot 10^{+61}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{t - z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\end{array}
\end{array}
if t < -7.50000000000000042e54 or 9e61 < t Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 91.1%
neg-mul-191.1%
distribute-neg-frac291.1%
Simplified91.1%
distribute-frac-neg291.1%
neg-sub091.1%
Applied egg-rr91.1%
neg-sub091.1%
distribute-neg-frac291.1%
sub-neg91.1%
distribute-neg-in91.1%
remove-double-neg91.1%
+-commutative91.1%
sub-neg91.1%
Simplified91.1%
if -7.50000000000000042e54 < t < 9e61Initial program 97.4%
Taylor expanded in z around inf 88.7%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.7e-109) (not (<= t 1.6e-98))) (+ x (/ y (/ t (- t z)))) (- x (* z (* y (/ -1.0 a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.7e-109) || !(t <= 1.6e-98)) {
tmp = x + (y / (t / (t - z)));
} else {
tmp = x - (z * (y * (-1.0 / 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 ((t <= (-2.7d-109)) .or. (.not. (t <= 1.6d-98))) then
tmp = x + (y / (t / (t - z)))
else
tmp = x - (z * (y * ((-1.0d0) / a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.7e-109) || !(t <= 1.6e-98)) {
tmp = x + (y / (t / (t - z)));
} else {
tmp = x - (z * (y * (-1.0 / a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.7e-109) or not (t <= 1.6e-98): tmp = x + (y / (t / (t - z))) else: tmp = x - (z * (y * (-1.0 / a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.7e-109) || !(t <= 1.6e-98)) tmp = Float64(x + Float64(y / Float64(t / Float64(t - z)))); else tmp = Float64(x - Float64(z * Float64(y * Float64(-1.0 / a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.7e-109) || ~((t <= 1.6e-98))) tmp = x + (y / (t / (t - z))); else tmp = x - (z * (y * (-1.0 / a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.7e-109], N[Not[LessEqual[t, 1.6e-98]], $MachinePrecision]], N[(x + N[(y / N[(t / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(y * N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{-109} \lor \neg \left(t \leq 1.6 \cdot 10^{-98}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{t - z}}\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \left(y \cdot \frac{-1}{a}\right)\\
\end{array}
\end{array}
if t < -2.7e-109 or 1.6e-98 < t Initial program 99.0%
clear-num98.9%
un-div-inv98.9%
Applied egg-rr98.9%
Taylor expanded in a around 0 85.4%
neg-mul-185.4%
distribute-neg-frac285.4%
Simplified85.4%
distribute-frac-neg285.4%
neg-sub085.4%
Applied egg-rr85.4%
neg-sub085.4%
distribute-neg-frac285.4%
sub-neg85.4%
distribute-neg-in85.4%
remove-double-neg85.4%
+-commutative85.4%
sub-neg85.4%
Simplified85.4%
if -2.7e-109 < t < 1.6e-98Initial program 97.1%
Taylor expanded in t around 0 84.3%
div-inv84.3%
*-commutative84.3%
associate-*l*89.9%
Applied egg-rr89.9%
Final simplification86.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -7800000.0) (+ x (* y (/ t (- t a)))) (if (<= t 1.32e+62) (+ x (/ (* y z) (- a t))) (+ x (- y (* z (/ y t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7800000.0) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 1.32e+62) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y - (z * (y / 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 <= (-7800000.0d0)) then
tmp = x + (y * (t / (t - a)))
else if (t <= 1.32d+62) then
tmp = x + ((y * z) / (a - t))
else
tmp = x + (y - (z * (y / 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 <= -7800000.0) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 1.32e+62) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y - (z * (y / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7800000.0: tmp = x + (y * (t / (t - a))) elif t <= 1.32e+62: tmp = x + ((y * z) / (a - t)) else: tmp = x + (y - (z * (y / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7800000.0) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); elseif (t <= 1.32e+62) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(x + Float64(y - Float64(z * Float64(y / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7800000.0) tmp = x + (y * (t / (t - a))); elseif (t <= 1.32e+62) tmp = x + ((y * z) / (a - t)); else tmp = x + (y - (z * (y / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7800000.0], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.32e+62], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7800000:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{elif}\;t \leq 1.32 \cdot 10^{+62}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z \cdot \frac{y}{t}\right)\\
\end{array}
\end{array}
if t < -7.8e6Initial program 99.9%
Taylor expanded in z around 0 75.4%
mul-1-neg75.4%
unsub-neg75.4%
*-commutative75.4%
associate-/l*92.7%
Simplified92.7%
if -7.8e6 < t < 1.3199999999999999e62Initial program 97.3%
Taylor expanded in z around inf 89.4%
if 1.3199999999999999e62 < t Initial program 99.9%
Taylor expanded in a around 0 66.8%
mul-1-neg66.8%
unsub-neg66.8%
associate-/l*90.0%
div-sub90.0%
sub-neg90.0%
*-inverses90.0%
metadata-eval90.0%
Simplified90.0%
distribute-lft-in90.0%
clear-num90.0%
un-div-inv90.1%
Applied egg-rr90.1%
*-commutative90.1%
neg-mul-190.1%
unsub-neg90.1%
associate-/r/91.9%
Simplified91.9%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -1020000.0) (+ x (* y (/ t (- t a)))) (if (<= t 9e+61) (+ x (/ (* y z) (- a t))) (+ x (/ y (/ t (- t z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1020000.0) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 9e+61) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y / (t / (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 (t <= (-1020000.0d0)) then
tmp = x + (y * (t / (t - a)))
else if (t <= 9d+61) then
tmp = x + ((y * z) / (a - t))
else
tmp = x + (y / (t / (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 (t <= -1020000.0) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 9e+61) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y / (t / (t - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1020000.0: tmp = x + (y * (t / (t - a))) elif t <= 9e+61: tmp = x + ((y * z) / (a - t)) else: tmp = x + (y / (t / (t - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1020000.0) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); elseif (t <= 9e+61) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(x + Float64(y / Float64(t / Float64(t - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1020000.0) tmp = x + (y * (t / (t - a))); elseif (t <= 9e+61) tmp = x + ((y * z) / (a - t)); else tmp = x + (y / (t / (t - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1020000.0], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e+61], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1020000:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+61}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{t - z}}\\
\end{array}
\end{array}
if t < -1.02e6Initial program 99.9%
Taylor expanded in z around 0 75.4%
mul-1-neg75.4%
unsub-neg75.4%
*-commutative75.4%
associate-/l*92.7%
Simplified92.7%
if -1.02e6 < t < 9e61Initial program 97.3%
Taylor expanded in z around inf 89.4%
if 9e61 < t Initial program 99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in a around 0 90.1%
neg-mul-190.1%
distribute-neg-frac290.1%
Simplified90.1%
distribute-frac-neg290.1%
neg-sub090.1%
Applied egg-rr90.1%
neg-sub090.1%
distribute-neg-frac290.1%
sub-neg90.1%
distribute-neg-in90.1%
remove-double-neg90.1%
+-commutative90.1%
sub-neg90.1%
Simplified90.1%
Final simplification90.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.65e+15) (not (<= t 2.4e-15))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.65e+15) || !(t <= 2.4e-15)) {
tmp = x + y;
} else {
tmp = x + (y / (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 ((t <= (-2.65d+15)) .or. (.not. (t <= 2.4d-15))) then
tmp = x + y
else
tmp = x + (y / (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 ((t <= -2.65e+15) || !(t <= 2.4e-15)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.65e+15) or not (t <= 2.4e-15): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.65e+15) || !(t <= 2.4e-15)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.65e+15) || ~((t <= 2.4e-15))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.65e+15], N[Not[LessEqual[t, 2.4e-15]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.65 \cdot 10^{+15} \lor \neg \left(t \leq 2.4 \cdot 10^{-15}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -2.65e15 or 2.39999999999999995e-15 < t Initial program 99.9%
Taylor expanded in t around inf 80.9%
+-commutative80.9%
Simplified80.9%
if -2.65e15 < t < 2.39999999999999995e-15Initial program 96.9%
clear-num96.7%
un-div-inv97.0%
Applied egg-rr97.0%
Taylor expanded in t around 0 79.9%
Final simplification80.4%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 98.5%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + y;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 98.5%
Taylor expanded in t around inf 64.4%
+-commutative64.4%
Simplified64.4%
Final simplification64.4%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 98.5%
Taylor expanded in x around inf 52.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} 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 - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
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 - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024108
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))