
(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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
Initial program 89.3%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.5%
Applied egg-rr99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (/ (- a t) (- z t)))) (t_2 (/ (* y (- z t)) (- a t))))
(if (<= t_2 -2e+165)
t_1
(if (<= t_2 2e+99) (+ x (* y (/ t (- t a)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / ((a - t) / (z - t));
double t_2 = (y * (z - t)) / (a - t);
double tmp;
if (t_2 <= -2e+165) {
tmp = t_1;
} else if (t_2 <= 2e+99) {
tmp = x + (y * (t / (t - a)));
} 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) :: t_2
real(8) :: tmp
t_1 = y / ((a - t) / (z - t))
t_2 = (y * (z - t)) / (a - t)
if (t_2 <= (-2d+165)) then
tmp = t_1
else if (t_2 <= 2d+99) then
tmp = x + (y * (t / (t - a)))
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 = y / ((a - t) / (z - t));
double t_2 = (y * (z - t)) / (a - t);
double tmp;
if (t_2 <= -2e+165) {
tmp = t_1;
} else if (t_2 <= 2e+99) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / ((a - t) / (z - t)) t_2 = (y * (z - t)) / (a - t) tmp = 0 if t_2 <= -2e+165: tmp = t_1 elif t_2 <= 2e+99: tmp = x + (y * (t / (t - a))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(Float64(a - t) / Float64(z - t))) t_2 = Float64(Float64(y * Float64(z - t)) / Float64(a - t)) tmp = 0.0 if (t_2 <= -2e+165) tmp = t_1; elseif (t_2 <= 2e+99) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / ((a - t) / (z - t)); t_2 = (y * (z - t)) / (a - t); tmp = 0.0; if (t_2 <= -2e+165) tmp = t_1; elseif (t_2 <= 2e+99) tmp = x + (y * (t / (t - a))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+165], t$95$1, If[LessEqual[t$95$2, 2e+99], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{\frac{a - t}{z - t}}\\
t_2 := \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+165}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+99}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -1.9999999999999998e165 or 1.9999999999999999e99 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 69.4%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6466.1%
Simplified66.1%
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6490.8%
Applied egg-rr90.8%
if -1.9999999999999998e165 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 1.9999999999999999e99Initial program 99.9%
Taylor expanded in z around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6485.2%
Simplified85.2%
Final simplification87.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (* y (- 1.0 (/ z t)))))) (if (<= t -4e-57) t_1 (if (<= t 4.5e-100) (+ x (/ y (/ a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (1.0 - (z / t)));
double tmp;
if (t <= -4e-57) {
tmp = t_1;
} else if (t <= 4.5e-100) {
tmp = x + (y / (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 * (1.0d0 - (z / t)))
if (t <= (-4d-57)) then
tmp = t_1
else if (t <= 4.5d-100) then
tmp = x + (y / (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 * (1.0 - (z / t)));
double tmp;
if (t <= -4e-57) {
tmp = t_1;
} else if (t <= 4.5e-100) {
tmp = x + (y / (a / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (1.0 - (z / t))) tmp = 0 if t <= -4e-57: tmp = t_1 elif t <= 4.5e-100: tmp = x + (y / (a / z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))) tmp = 0.0 if (t <= -4e-57) tmp = t_1; elseif (t <= 4.5e-100) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (1.0 - (z / t))); tmp = 0.0; if (t <= -4e-57) tmp = t_1; elseif (t <= 4.5e-100) tmp = x + (y / (a / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4e-57], t$95$1, If[LessEqual[t, 4.5e-100], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{if}\;t \leq -4 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-100}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.99999999999999982e-57 or 4.5000000000000001e-100 < t Initial program 85.8%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6481.2%
Simplified81.2%
if -3.99999999999999982e-57 < t < 4.5000000000000001e-100Initial program 95.7%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6498.9%
Applied egg-rr98.9%
Taylor expanded in t around 0
/-lowering-/.f6487.9%
Simplified87.9%
Final simplification83.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.8e+43) (+ x y) (if (<= t 8.8e-60) (+ x (/ y (/ a z))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.8e+43) {
tmp = x + y;
} else if (t <= 8.8e-60) {
tmp = x + (y / (a / z));
} 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 <= (-3.8d+43)) then
tmp = x + y
else if (t <= 8.8d-60) then
tmp = x + (y / (a / z))
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 <= -3.8e+43) {
tmp = x + y;
} else if (t <= 8.8e-60) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.8e+43: tmp = x + y elif t <= 8.8e-60: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.8e+43) tmp = Float64(x + y); elseif (t <= 8.8e-60) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.8e+43) tmp = x + y; elseif (t <= 8.8e-60) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.8e+43], N[(x + y), $MachinePrecision], If[LessEqual[t, 8.8e-60], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+43}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{-60}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.80000000000000008e43 or 8.7999999999999995e-60 < t Initial program 81.7%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6474.7%
Simplified74.7%
if -3.80000000000000008e43 < t < 8.7999999999999995e-60Initial program 96.9%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.2%
Applied egg-rr99.2%
Taylor expanded in t around 0
/-lowering-/.f6479.3%
Simplified79.3%
Final simplification77.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (/ z (- a t))))) (if (<= z -1.4e+123) t_1 (if (<= z 9e+47) (+ x y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / (a - t));
double tmp;
if (z <= -1.4e+123) {
tmp = t_1;
} else if (z <= 9e+47) {
tmp = x + y;
} 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 = y * (z / (a - t))
if (z <= (-1.4d+123)) then
tmp = t_1
else if (z <= 9d+47) then
tmp = x + y
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 = y * (z / (a - t));
double tmp;
if (z <= -1.4e+123) {
tmp = t_1;
} else if (z <= 9e+47) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / (a - t)) tmp = 0 if z <= -1.4e+123: tmp = t_1 elif z <= 9e+47: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / Float64(a - t))) tmp = 0.0 if (z <= -1.4e+123) tmp = t_1; elseif (z <= 9e+47) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / (a - t)); tmp = 0.0; if (z <= -1.4e+123) tmp = t_1; elseif (z <= 9e+47) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.4e+123], t$95$1, If[LessEqual[z, 9e+47], N[(x + y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{a - t}\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{+123}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+47}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.40000000000000006e123 or 8.99999999999999958e47 < z Initial program 85.7%
Taylor expanded in z around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6466.8%
Simplified66.8%
if -1.40000000000000006e123 < z < 8.99999999999999958e47Initial program 91.8%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6473.8%
Simplified73.8%
Final simplification70.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.35e+125) (* y (/ z a)) (if (<= z 2.4e+243) (+ x y) (* y (- 1.0 (/ z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.35e+125) {
tmp = y * (z / a);
} else if (z <= 2.4e+243) {
tmp = x + y;
} else {
tmp = y * (1.0 - (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 (z <= (-3.35d+125)) then
tmp = y * (z / a)
else if (z <= 2.4d+243) then
tmp = x + y
else
tmp = y * (1.0d0 - (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 (z <= -3.35e+125) {
tmp = y * (z / a);
} else if (z <= 2.4e+243) {
tmp = x + y;
} else {
tmp = y * (1.0 - (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.35e+125: tmp = y * (z / a) elif z <= 2.4e+243: tmp = x + y else: tmp = y * (1.0 - (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.35e+125) tmp = Float64(y * Float64(z / a)); elseif (z <= 2.4e+243) tmp = Float64(x + y); else tmp = Float64(y * Float64(1.0 - Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.35e+125) tmp = y * (z / a); elseif (z <= 2.4e+243) tmp = x + y; else tmp = y * (1.0 - (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.35e+125], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e+243], N[(x + y), $MachinePrecision], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.35 \cdot 10^{+125}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+243}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\
\end{array}
\end{array}
if z < -3.3500000000000002e125Initial program 89.0%
Taylor expanded in z around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6472.6%
Simplified72.6%
Taylor expanded in a around inf
Simplified58.5%
if -3.3500000000000002e125 < z < 2.4e243Initial program 90.8%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6465.3%
Simplified65.3%
if 2.4e243 < z Initial program 68.7%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6480.5%
Simplified80.5%
Taylor expanded in x around 0
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f6480.5%
Simplified80.5%
Final simplification65.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (/ z a)))) (if (<= z -1.15e+126) t_1 (if (<= z 2.5e+244) (+ x y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / a);
double tmp;
if (z <= -1.15e+126) {
tmp = t_1;
} else if (z <= 2.5e+244) {
tmp = x + y;
} 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 = y * (z / a)
if (z <= (-1.15d+126)) then
tmp = t_1
else if (z <= 2.5d+244) then
tmp = x + y
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 = y * (z / a);
double tmp;
if (z <= -1.15e+126) {
tmp = t_1;
} else if (z <= 2.5e+244) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / a) tmp = 0 if z <= -1.15e+126: tmp = t_1 elif z <= 2.5e+244: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / a)) tmp = 0.0 if (z <= -1.15e+126) tmp = t_1; elseif (z <= 2.5e+244) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / a); tmp = 0.0; if (z <= -1.15e+126) tmp = t_1; elseif (z <= 2.5e+244) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e+126], t$95$1, If[LessEqual[z, 2.5e+244], N[(x + y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{a}\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{+126}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+244}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.15e126 or 2.50000000000000011e244 < z Initial program 82.9%
Taylor expanded in z around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6478.2%
Simplified78.2%
Taylor expanded in a around inf
Simplified57.1%
if -1.15e126 < z < 2.50000000000000011e244Initial program 90.8%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6465.3%
Simplified65.3%
Final simplification63.7%
(FPCore (x y z t a) :precision binary64 (if (<= x -3.6e-115) x (if (<= x 4.8e-140) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -3.6e-115) {
tmp = x;
} else if (x <= 4.8e-140) {
tmp = 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 (x <= (-3.6d-115)) then
tmp = x
else if (x <= 4.8d-140) then
tmp = 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 (x <= -3.6e-115) {
tmp = x;
} else if (x <= 4.8e-140) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -3.6e-115: tmp = x elif x <= 4.8e-140: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -3.6e-115) tmp = x; elseif (x <= 4.8e-140) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -3.6e-115) tmp = x; elseif (x <= 4.8e-140) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -3.6e-115], x, If[LessEqual[x, 4.8e-140], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{-115}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-140}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.60000000000000009e-115 or 4.79999999999999973e-140 < x Initial program 89.7%
Taylor expanded in x around inf
Simplified61.1%
if -3.60000000000000009e-115 < x < 4.79999999999999973e-140Initial program 88.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6479.6%
Simplified79.6%
Taylor expanded in t around inf
Simplified36.2%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (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 + ((z - t) * (y / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (a - t)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{a - t}
\end{array}
Initial program 89.3%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6495.4%
Applied egg-rr95.4%
Final simplification95.4%
(FPCore (x y z t a) :precision binary64 (if (<= a 3.6e+140) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 3.6e+140) {
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 <= 3.6d+140) 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 <= 3.6e+140) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 3.6e+140: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 3.6e+140) 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 <= 3.6e+140) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 3.6e+140], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.6 \cdot 10^{+140}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 3.6e140Initial program 90.1%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6459.6%
Simplified59.6%
if 3.6e140 < a Initial program 81.7%
Taylor expanded in x around inf
Simplified59.8%
Final simplification59.6%
(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 89.3%
Taylor expanded in x around inf
Simplified46.7%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2024160
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- a t) (- z t)))))
(+ x (/ (* y (- z t)) (- a t))))