
(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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (* y (/ (- z t) (- z a))) x))
double code(double x, double y, double z, double t, double a) {
return (y * ((z - t) / (z - a))) + 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 = (y * ((z - t) / (z - a))) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return (y * ((z - t) / (z - a))) + x;
}
def code(x, y, z, t, a): return (y * ((z - t) / (z - a))) + x
function code(x, y, z, t, a) return Float64(Float64(y * Float64(Float64(z - t) / Float64(z - a))) + x) end
function tmp = code(x, y, z, t, a) tmp = (y * ((z - t) / (z - a))) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \frac{z - t}{z - a} + x
\end{array}
Initial program 83.5%
+-commutative83.5%
associate-/l*98.8%
fma-define98.8%
Simplified98.8%
fma-undefine98.8%
Applied egg-rr98.8%
Final simplification98.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (or (<= t_1 -4e+288) (not (<= t_1 2e+285)))
(/ y (/ (- z a) (- z t)))
(+ x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -4e+288) || !(t_1 <= 2e+285)) {
tmp = y / ((z - a) / (z - t));
} else {
tmp = x + 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 = (y * (z - t)) / (z - a)
if ((t_1 <= (-4d+288)) .or. (.not. (t_1 <= 2d+285))) then
tmp = y / ((z - a) / (z - t))
else
tmp = x + 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 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -4e+288) || !(t_1 <= 2e+285)) {
tmp = y / ((z - a) / (z - t));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if (t_1 <= -4e+288) or not (t_1 <= 2e+285): tmp = y / ((z - a) / (z - t)) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if ((t_1 <= -4e+288) || !(t_1 <= 2e+285)) tmp = Float64(y / Float64(Float64(z - a) / Float64(z - t))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (z - a); tmp = 0.0; if ((t_1 <= -4e+288) || ~((t_1 <= 2e+285))) tmp = y / ((z - a) / (z - t)); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -4e+288], N[Not[LessEqual[t$95$1, 2e+285]], $MachinePrecision]], N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+288} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+285}\right):\\
\;\;\;\;\frac{y}{\frac{z - a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -4e288 or 2e285 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 32.0%
+-commutative32.0%
associate-/l*99.9%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around inf 89.2%
div-sub89.2%
associate-*r/32.0%
associate-*l/87.5%
Simplified87.5%
associate-/r/89.1%
Applied egg-rr89.1%
if -4e288 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2e285Initial program 99.6%
Final simplification97.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3e+79)
(+ y x)
(if (<= z 1.02e-22)
(+ x (* t (/ y a)))
(if (<= z 3.3e+70) (* (- z t) (/ y (- z a))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3e+79) {
tmp = y + x;
} else if (z <= 1.02e-22) {
tmp = x + (t * (y / a));
} else if (z <= 3.3e+70) {
tmp = (z - t) * (y / (z - a));
} else {
tmp = y + 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 <= (-3d+79)) then
tmp = y + x
else if (z <= 1.02d-22) then
tmp = x + (t * (y / a))
else if (z <= 3.3d+70) then
tmp = (z - t) * (y / (z - a))
else
tmp = y + 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 <= -3e+79) {
tmp = y + x;
} else if (z <= 1.02e-22) {
tmp = x + (t * (y / a));
} else if (z <= 3.3e+70) {
tmp = (z - t) * (y / (z - a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3e+79: tmp = y + x elif z <= 1.02e-22: tmp = x + (t * (y / a)) elif z <= 3.3e+70: tmp = (z - t) * (y / (z - a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3e+79) tmp = Float64(y + x); elseif (z <= 1.02e-22) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 3.3e+70) tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3e+79) tmp = y + x; elseif (z <= 1.02e-22) tmp = x + (t * (y / a)); elseif (z <= 3.3e+70) tmp = (z - t) * (y / (z - a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3e+79], N[(y + x), $MachinePrecision], If[LessEqual[z, 1.02e-22], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e+70], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+79}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-22}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+70}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -2.99999999999999974e79 or 3.30000000000000016e70 < z Initial program 69.1%
+-commutative69.1%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 83.7%
+-commutative83.7%
Simplified83.7%
if -2.99999999999999974e79 < z < 1.02000000000000002e-22Initial program 92.3%
+-commutative92.3%
associate-/l*97.8%
fma-define97.8%
Simplified97.8%
Taylor expanded in z around 0 76.1%
+-commutative76.1%
associate-/l*82.7%
Simplified82.7%
if 1.02000000000000002e-22 < z < 3.30000000000000016e70Initial program 90.1%
+-commutative90.1%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around inf 70.5%
div-sub70.5%
associate-*r/60.7%
associate-*l/70.4%
Simplified70.4%
Final simplification81.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.12e+123) (not (<= z 3e+73))) (+ y x) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.12e+123) || !(z <= 3e+73)) {
tmp = y + x;
} 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 <= (-1.12d+123)) .or. (.not. (z <= 3d+73))) then
tmp = y + x
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 <= -1.12e+123) || !(z <= 3e+73)) {
tmp = y + x;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.12e+123) or not (z <= 3e+73): tmp = y + x else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.12e+123) || !(z <= 3e+73)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.12e+123) || ~((z <= 3e+73))) tmp = y + x; else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.12e+123], N[Not[LessEqual[z, 3e+73]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{+123} \lor \neg \left(z \leq 3 \cdot 10^{+73}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -1.12e123 or 3.00000000000000011e73 < z Initial program 66.3%
+-commutative66.3%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 85.4%
+-commutative85.4%
Simplified85.4%
if -1.12e123 < z < 3.00000000000000011e73Initial program 92.3%
Taylor expanded in t around inf 81.9%
mul-1-neg81.9%
distribute-neg-frac281.9%
associate-*r/87.6%
sub-neg87.6%
distribute-neg-in87.6%
remove-double-neg87.6%
Simplified87.6%
Taylor expanded in t around 0 81.9%
*-commutative81.9%
associate-/l*87.2%
Simplified87.2%
Final simplification86.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.2e+55) (not (<= t 3.9e+117))) (+ x (* y (/ t (- a z)))) (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e+55) || !(t <= 3.9e+117)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.2d+55)) .or. (.not. (t <= 3.9d+117))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (y * (z / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e+55) || !(t <= 3.9e+117)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.2e+55) or not (t <= 3.9e+117): tmp = x + (y * (t / (a - z))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.2e+55) || !(t <= 3.9e+117)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.2e+55) || ~((t <= 3.9e+117))) tmp = x + (y * (t / (a - z))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.2e+55], N[Not[LessEqual[t, 3.9e+117]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+55} \lor \neg \left(t \leq 3.9 \cdot 10^{+117}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -2.2000000000000001e55 or 3.8999999999999999e117 < t Initial program 77.9%
Taylor expanded in t around inf 75.8%
mul-1-neg75.8%
distribute-neg-frac275.8%
associate-*r/89.5%
sub-neg89.5%
distribute-neg-in89.5%
remove-double-neg89.5%
Simplified89.5%
Taylor expanded in t around 0 75.8%
*-commutative75.8%
associate-/l*87.6%
Simplified87.6%
if -2.2000000000000001e55 < t < 3.8999999999999999e117Initial program 87.1%
Taylor expanded in t around 0 77.1%
associate-/l*88.8%
Simplified88.8%
Final simplification88.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.5e+123) (+ x (* y (/ (- z t) z))) (if (<= z 1.25e+73) (+ x (* y (/ t (- a z)))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e+123) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 1.25e+73) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.5d+123)) then
tmp = x + (y * ((z - t) / z))
else if (z <= 1.25d+73) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (y * (z / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e+123) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 1.25e+73) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.5e+123: tmp = x + (y * ((z - t) / z)) elif z <= 1.25e+73: tmp = x + (y * (t / (a - z))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.5e+123) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); elseif (z <= 1.25e+73) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.5e+123) tmp = x + (y * ((z - t) / z)); elseif (z <= 1.25e+73) tmp = x + (y * (t / (a - z))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.5e+123], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e+73], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+123}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+73}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -3.5e123Initial program 61.9%
+-commutative61.9%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 61.6%
+-commutative61.6%
associate-/l*95.0%
Simplified95.0%
if -3.5e123 < z < 1.24999999999999994e73Initial program 92.3%
Taylor expanded in t around inf 81.9%
mul-1-neg81.9%
distribute-neg-frac281.9%
associate-*r/87.6%
sub-neg87.6%
distribute-neg-in87.6%
remove-double-neg87.6%
Simplified87.6%
Taylor expanded in t around 0 81.9%
*-commutative81.9%
associate-/l*87.2%
Simplified87.2%
if 1.24999999999999994e73 < z Initial program 70.1%
Taylor expanded in t around 0 66.1%
associate-/l*92.4%
Simplified92.4%
Final simplification89.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.65e+120) (+ x (* y (/ (- z t) z))) (if (<= z 3e+72) (+ x (* t (/ y (- a z)))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.65e+120) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 3e+72) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.65d+120)) then
tmp = x + (y * ((z - t) / z))
else if (z <= 3d+72) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (y * (z / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.65e+120) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 3e+72) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.65e+120: tmp = x + (y * ((z - t) / z)) elif z <= 3e+72: tmp = x + (t * (y / (a - z))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.65e+120) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); elseif (z <= 3e+72) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.65e+120) tmp = x + (y * ((z - t) / z)); elseif (z <= 3e+72) tmp = x + (t * (y / (a - z))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.65e+120], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+72], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.65 \cdot 10^{+120}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+72}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -3.6500000000000002e120Initial program 61.9%
+-commutative61.9%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 61.6%
+-commutative61.6%
associate-/l*95.0%
Simplified95.0%
if -3.6500000000000002e120 < z < 3.00000000000000003e72Initial program 92.3%
Taylor expanded in t around inf 81.9%
mul-1-neg81.9%
distribute-neg-frac281.9%
associate-*r/87.6%
sub-neg87.6%
distribute-neg-in87.6%
remove-double-neg87.6%
Simplified87.6%
if 3.00000000000000003e72 < z Initial program 70.1%
Taylor expanded in t around 0 66.1%
associate-/l*92.4%
Simplified92.4%
Final simplification89.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.2e+15) (not (<= z 7e+20))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.2e+15) || !(z <= 7e+20)) {
tmp = y + x;
} 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.2d+15)) .or. (.not. (z <= 7d+20))) then
tmp = y + x
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.2e+15) || !(z <= 7e+20)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.2e+15) or not (z <= 7e+20): tmp = y + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.2e+15) || !(z <= 7e+20)) tmp = Float64(y + x); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.2e+15) || ~((z <= 7e+20))) tmp = y + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.2e+15], N[Not[LessEqual[z, 7e+20]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+15} \lor \neg \left(z \leq 7 \cdot 10^{+20}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -3.2e15 or 7e20 < z Initial program 72.0%
+-commutative72.0%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 78.4%
+-commutative78.4%
Simplified78.4%
if -3.2e15 < z < 7e20Initial program 93.8%
Taylor expanded in z around 0 74.1%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.2e+82) (not (<= z 2.15e+22))) (+ y x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.2e+82) || !(z <= 2.15e+22)) {
tmp = y + x;
} 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 <= (-2.2d+82)) .or. (.not. (z <= 2.15d+22))) then
tmp = y + x
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 <= -2.2e+82) || !(z <= 2.15e+22)) {
tmp = y + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.2e+82) or not (z <= 2.15e+22): tmp = y + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.2e+82) || !(z <= 2.15e+22)) tmp = Float64(y + x); 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 <= -2.2e+82) || ~((z <= 2.15e+22))) tmp = y + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.2e+82], N[Not[LessEqual[z, 2.15e+22]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+82} \lor \neg \left(z \leq 2.15 \cdot 10^{+22}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.2000000000000001e82 or 2.1500000000000001e22 < z Initial program 70.7%
+-commutative70.7%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 79.5%
+-commutative79.5%
Simplified79.5%
if -2.2000000000000001e82 < z < 2.1500000000000001e22Initial program 92.9%
+-commutative92.9%
associate-/l*98.0%
fma-define98.0%
Simplified98.0%
Taylor expanded in z around 0 73.6%
+-commutative73.6%
associate-/l*79.6%
Simplified79.6%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.2e+153) x (if (<= a 5.6e+199) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.2e+153) {
tmp = x;
} else if (a <= 5.6e+199) {
tmp = y + x;
} 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 <= (-1.2d+153)) then
tmp = x
else if (a <= 5.6d+199) then
tmp = y + x
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 <= -1.2e+153) {
tmp = x;
} else if (a <= 5.6e+199) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.2e+153: tmp = x elif a <= 5.6e+199: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.2e+153) tmp = x; elseif (a <= 5.6e+199) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.2e+153) tmp = x; elseif (a <= 5.6e+199) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.2e+153], x, If[LessEqual[a, 5.6e+199], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.2 \cdot 10^{+153}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.6 \cdot 10^{+199}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.19999999999999996e153 or 5.6000000000000002e199 < a Initial program 76.1%
+-commutative76.1%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around 0 67.2%
if -1.19999999999999996e153 < a < 5.6000000000000002e199Initial program 85.5%
+-commutative85.5%
associate-/l*98.5%
fma-define98.5%
Simplified98.5%
Taylor expanded in z around inf 64.1%
+-commutative64.1%
Simplified64.1%
Final simplification64.8%
(FPCore (x y z t a) :precision binary64 (if (<= y 9.6e+92) x y))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 9.6e+92) {
tmp = x;
} else {
tmp = 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 (y <= 9.6d+92) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 9.6e+92) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 9.6e+92: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 9.6e+92) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 9.6e+92) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 9.6e+92], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.6 \cdot 10^{+92}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 9.60000000000000018e92Initial program 90.0%
+-commutative90.0%
associate-/l*98.6%
fma-define98.6%
Simplified98.6%
Taylor expanded in y around 0 56.8%
if 9.60000000000000018e92 < y Initial program 55.0%
+-commutative55.0%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around inf 86.0%
div-sub86.0%
associate-*r/46.9%
associate-*l/81.8%
Simplified81.8%
Taylor expanded in z around inf 54.2%
Taylor expanded in z around inf 39.0%
Final simplification53.5%
(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 83.5%
+-commutative83.5%
associate-/l*98.8%
fma-define98.8%
Simplified98.8%
Taylor expanded in y around 0 48.6%
Final simplification48.6%
(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 2024079
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))