
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\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) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\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(y / Float64(Float64(z - a) / Float64(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[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
Initial program 98.4%
clear-num98.4%
un-div-inv98.5%
Applied egg-rr98.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -6.4e+102)
t_1
(if (<= z -6.8e-52)
(- x (* y (/ t z)))
(if (<= z 1.76e-65) (+ x (/ y (/ a t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -6.4e+102) {
tmp = t_1;
} else if (z <= -6.8e-52) {
tmp = x - (y * (t / z));
} else if (z <= 1.76e-65) {
tmp = x + (y / (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 / (z - a)))
if (z <= (-6.4d+102)) then
tmp = t_1
else if (z <= (-6.8d-52)) then
tmp = x - (y * (t / z))
else if (z <= 1.76d-65) then
tmp = x + (y / (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 / (z - a)));
double tmp;
if (z <= -6.4e+102) {
tmp = t_1;
} else if (z <= -6.8e-52) {
tmp = x - (y * (t / z));
} else if (z <= 1.76e-65) {
tmp = x + (y / (a / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -6.4e+102: tmp = t_1 elif z <= -6.8e-52: tmp = x - (y * (t / z)) elif z <= 1.76e-65: tmp = x + (y / (a / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a)))) tmp = 0.0 if (z <= -6.4e+102) tmp = t_1; elseif (z <= -6.8e-52) tmp = Float64(x - Float64(y * Float64(t / z))); elseif (z <= 1.76e-65) tmp = Float64(x + Float64(y / 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 / (z - a))); tmp = 0.0; if (z <= -6.4e+102) tmp = t_1; elseif (z <= -6.8e-52) tmp = x - (y * (t / z)); elseif (z <= 1.76e-65) tmp = x + (y / (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[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.4e+102], t$95$1, If[LessEqual[z, -6.8e-52], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.76e-65], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -6.4 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-52}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 1.76 \cdot 10^{-65}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.3999999999999999e102 or 1.7600000000000001e-65 < z Initial program 100.0%
Taylor expanded in t around 0 65.8%
associate-/l*89.0%
Simplified89.0%
if -6.3999999999999999e102 < z < -6.80000000000000035e-52Initial program 99.8%
Taylor expanded in a around 0 68.4%
associate-/l*74.1%
*-commutative74.1%
Applied egg-rr74.1%
Taylor expanded in z around 0 70.2%
mul-1-neg70.2%
distribute-neg-frac270.2%
Simplified70.2%
if -6.80000000000000035e-52 < z < 1.7600000000000001e-65Initial program 96.5%
clear-num96.4%
un-div-inv96.9%
Applied egg-rr96.9%
Taylor expanded in z around 0 83.1%
Final simplification83.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.15e+104)
(+ x y)
(if (<= z -4.4e-52)
(- x (* y (/ t z)))
(if (<= z 4.8e-30) (+ x (/ y (/ a t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.15e+104) {
tmp = x + y;
} else if (z <= -4.4e-52) {
tmp = x - (y * (t / z));
} else if (z <= 4.8e-30) {
tmp = x + (y / (a / 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 (z <= (-1.15d+104)) then
tmp = x + y
else if (z <= (-4.4d-52)) then
tmp = x - (y * (t / z))
else if (z <= 4.8d-30) then
tmp = x + (y / (a / 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 (z <= -1.15e+104) {
tmp = x + y;
} else if (z <= -4.4e-52) {
tmp = x - (y * (t / z));
} else if (z <= 4.8e-30) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.15e+104: tmp = x + y elif z <= -4.4e-52: tmp = x - (y * (t / z)) elif z <= 4.8e-30: tmp = x + (y / (a / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.15e+104) tmp = Float64(x + y); elseif (z <= -4.4e-52) tmp = Float64(x - Float64(y * Float64(t / z))); elseif (z <= 4.8e-30) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.15e+104) tmp = x + y; elseif (z <= -4.4e-52) tmp = x - (y * (t / z)); elseif (z <= 4.8e-30) tmp = x + (y / (a / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.15e+104], N[(x + y), $MachinePrecision], If[LessEqual[z, -4.4e-52], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e-30], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+104}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{-52}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-30}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.14999999999999992e104 or 4.7999999999999997e-30 < z Initial program 100.0%
Taylor expanded in z around inf 86.7%
if -1.14999999999999992e104 < z < -4.40000000000000018e-52Initial program 99.8%
Taylor expanded in a around 0 68.4%
associate-/l*74.1%
*-commutative74.1%
Applied egg-rr74.1%
Taylor expanded in z around 0 70.2%
mul-1-neg70.2%
distribute-neg-frac270.2%
Simplified70.2%
if -4.40000000000000018e-52 < z < 4.7999999999999997e-30Initial program 96.8%
clear-num96.7%
un-div-inv97.1%
Applied egg-rr97.1%
Taylor expanded in z around 0 80.7%
Final simplification81.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -7.5e+102)
(+ x y)
(if (<= z -9.2e-52)
(- x (* t (/ y z)))
(if (<= z 7e-31) (+ x (/ y (/ a t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5e+102) {
tmp = x + y;
} else if (z <= -9.2e-52) {
tmp = x - (t * (y / z));
} else if (z <= 7e-31) {
tmp = x + (y / (a / 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 (z <= (-7.5d+102)) then
tmp = x + y
else if (z <= (-9.2d-52)) then
tmp = x - (t * (y / z))
else if (z <= 7d-31) then
tmp = x + (y / (a / 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 (z <= -7.5e+102) {
tmp = x + y;
} else if (z <= -9.2e-52) {
tmp = x - (t * (y / z));
} else if (z <= 7e-31) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.5e+102: tmp = x + y elif z <= -9.2e-52: tmp = x - (t * (y / z)) elif z <= 7e-31: tmp = x + (y / (a / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.5e+102) tmp = Float64(x + y); elseif (z <= -9.2e-52) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 7e-31) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.5e+102) tmp = x + y; elseif (z <= -9.2e-52) tmp = x - (t * (y / z)); elseif (z <= 7e-31) tmp = x + (y / (a / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.5e+102], N[(x + y), $MachinePrecision], If[LessEqual[z, -9.2e-52], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e-31], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+102}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-52}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-31}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -7.5e102 or 6.99999999999999971e-31 < z Initial program 100.0%
Taylor expanded in z around inf 86.7%
if -7.5e102 < z < -9.19999999999999977e-52Initial program 99.8%
Taylor expanded in a around 0 68.4%
Taylor expanded in z around 0 64.7%
mul-1-neg64.7%
associate-/l*70.2%
distribute-rgt-neg-in70.2%
distribute-neg-frac270.2%
Simplified70.2%
if -9.19999999999999977e-52 < z < 6.99999999999999971e-31Initial program 96.8%
clear-num96.7%
un-div-inv97.1%
Applied egg-rr97.1%
Taylor expanded in z around 0 80.7%
Final simplification81.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1e+54) (not (<= z 4.4e-30))) (- x (* y (/ (- t z) z))) (+ x (/ (* y t) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e+54) || !(z <= 4.4e-30)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + ((y * t) / (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 ((z <= (-1d+54)) .or. (.not. (z <= 4.4d-30))) then
tmp = x - (y * ((t - z) / z))
else
tmp = x + ((y * t) / (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 ((z <= -1e+54) || !(z <= 4.4e-30)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1e+54) or not (z <= 4.4e-30): tmp = x - (y * ((t - z) / z)) else: tmp = x + ((y * t) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1e+54) || !(z <= 4.4e-30)) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); else tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1e+54) || ~((z <= 4.4e-30))) tmp = x - (y * ((t - z) / z)); else tmp = x + ((y * t) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1e+54], N[Not[LessEqual[z, 4.4e-30]], $MachinePrecision]], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+54} \lor \neg \left(z \leq 4.4 \cdot 10^{-30}\right):\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\end{array}
\end{array}
if z < -1.0000000000000001e54 or 4.39999999999999967e-30 < z Initial program 100.0%
Taylor expanded in a around 0 91.1%
if -1.0000000000000001e54 < z < 4.39999999999999967e-30Initial program 97.3%
associate-*r/93.4%
Simplified93.4%
Taylor expanded in z around 0 87.2%
mul-1-neg87.2%
distribute-lft-neg-out87.2%
*-commutative87.2%
Simplified87.2%
Final simplification88.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4e-70) (not (<= z 2.5e-117))) (- x (* y (/ (- t z) z))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4e-70) || !(z <= 2.5e-117)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + (y / (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 ((z <= (-4d-70)) .or. (.not. (z <= 2.5d-117))) then
tmp = x - (y * ((t - z) / z))
else
tmp = x + (y / (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 ((z <= -4e-70) || !(z <= 2.5e-117)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4e-70) or not (z <= 2.5e-117): tmp = x - (y * ((t - z) / z)) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4e-70) || !(z <= 2.5e-117)) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4e-70) || ~((z <= 2.5e-117))) tmp = x - (y * ((t - z) / z)); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4e-70], N[Not[LessEqual[z, 2.5e-117]], $MachinePrecision]], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-70} \lor \neg \left(z \leq 2.5 \cdot 10^{-117}\right):\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -3.99999999999999998e-70 or 2.5e-117 < z Initial program 99.9%
Taylor expanded in a around 0 86.1%
if -3.99999999999999998e-70 < z < 2.5e-117Initial program 95.8%
clear-num95.7%
un-div-inv96.3%
Applied egg-rr96.3%
Taylor expanded in z around 0 85.8%
Final simplification86.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.5e+82) (not (<= z 1.8e-30))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.5e+82) || !(z <= 1.8e-30)) {
tmp = x + y;
} else {
tmp = x + (y / (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 ((z <= (-7.5d+82)) .or. (.not. (z <= 1.8d-30))) then
tmp = x + y
else
tmp = x + (y / (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 ((z <= -7.5e+82) || !(z <= 1.8e-30)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.5e+82) or not (z <= 1.8e-30): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.5e+82) || !(z <= 1.8e-30)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.5e+82) || ~((z <= 1.8e-30))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.5e+82], N[Not[LessEqual[z, 1.8e-30]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+82} \lor \neg \left(z \leq 1.8 \cdot 10^{-30}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -7.4999999999999999e82 or 1.8000000000000002e-30 < z Initial program 100.0%
Taylor expanded in z around inf 85.3%
if -7.4999999999999999e82 < z < 1.8000000000000002e-30Initial program 97.4%
clear-num97.3%
un-div-inv97.6%
Applied egg-rr97.6%
Taylor expanded in z around 0 74.4%
Final simplification78.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.7e+87) (not (<= z 4.8e-30))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.7e+87) || !(z <= 4.8e-30)) {
tmp = x + y;
} 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 <= (-2.7d+87)) .or. (.not. (z <= 4.8d-30))) then
tmp = x + y
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 <= -2.7e+87) || !(z <= 4.8e-30)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.7e+87) or not (z <= 4.8e-30): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.7e+87) || !(z <= 4.8e-30)) tmp = Float64(x + y); 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 <= -2.7e+87) || ~((z <= 4.8e-30))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.7e+87], N[Not[LessEqual[z, 4.8e-30]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+87} \lor \neg \left(z \leq 4.8 \cdot 10^{-30}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.70000000000000007e87 or 4.7999999999999997e-30 < z Initial program 100.0%
Taylor expanded in z around inf 85.3%
if -2.70000000000000007e87 < z < 4.7999999999999997e-30Initial program 97.4%
Taylor expanded in z around 0 69.3%
*-commutative69.3%
associate-/l*74.2%
Simplified74.2%
Final simplification78.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.5e+82) (not (<= z 2.9e-30))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.5e+82) || !(z <= 2.9e-30)) {
tmp = x + y;
} 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 <= (-7.5d+82)) .or. (.not. (z <= 2.9d-30))) then
tmp = x + y
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 <= -7.5e+82) || !(z <= 2.9e-30)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.5e+82) or not (z <= 2.9e-30): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.5e+82) || !(z <= 2.9e-30)) tmp = Float64(x + y); 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 <= -7.5e+82) || ~((z <= 2.9e-30))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.5e+82], N[Not[LessEqual[z, 2.9e-30]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+82} \lor \neg \left(z \leq 2.9 \cdot 10^{-30}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -7.4999999999999999e82 or 2.89999999999999989e-30 < z Initial program 100.0%
Taylor expanded in z around inf 85.3%
if -7.4999999999999999e82 < z < 2.89999999999999989e-30Initial program 97.4%
Taylor expanded in z around 0 69.3%
associate-/l*73.2%
Simplified73.2%
Final simplification78.0%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 98.4%
(FPCore (x y z t a) :precision binary64 (if (<= a 2.4e+205) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 2.4e+205) {
tmp = x + y;
} 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 (a <= 2.4d+205) then
tmp = x + y
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 (a <= 2.4e+205) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 2.4e+205: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 2.4e+205) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 2.4e+205) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 2.4e+205], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.4 \cdot 10^{+205}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 2.39999999999999986e205Initial program 98.3%
Taylor expanded in z around inf 61.5%
if 2.39999999999999986e205 < a Initial program 99.9%
Taylor expanded in t around 0 67.2%
associate-/l*81.5%
Simplified81.5%
Taylor expanded in z around 0 66.6%
mul-1-neg66.6%
associate-/l*74.8%
distribute-rgt-neg-in74.8%
Simplified74.8%
add-sqr-sqrt67.6%
sqrt-unprod75.2%
sqr-neg75.2%
sqrt-unprod42.8%
add-sqr-sqrt70.2%
clear-num70.2%
un-div-inv70.2%
Applied egg-rr70.2%
associate-/r/70.2%
Simplified70.2%
Taylor expanded in x around inf 72.2%
(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.4%
Taylor expanded in t around 0 58.4%
associate-/l*68.3%
Simplified68.3%
Taylor expanded in z around 0 42.3%
mul-1-neg42.3%
associate-/l*44.1%
distribute-rgt-neg-in44.1%
Simplified44.1%
add-sqr-sqrt29.6%
sqrt-unprod42.4%
sqr-neg42.4%
sqrt-unprod22.2%
add-sqr-sqrt42.5%
clear-num42.5%
un-div-inv42.5%
Applied egg-rr42.5%
associate-/r/44.3%
Simplified44.3%
Taylor expanded in x around inf 48.4%
(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(y / Float64(Float64(z - a) / Float64(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[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024100
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))