
(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 11 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 (+ x (* (/ (- z t) (- z a)) y)))
double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (z - a)) * 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 + (((z - t) / (z - a)) * y)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (z - a)) * y);
}
def code(x, y, z, t, a): return x + (((z - t) / (z - a)) * y)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(z - t) / Float64(z - a)) * y)) end
function tmp = code(x, y, z, t, a) tmp = x + (((z - t) / (z - a)) * y); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{z - a} \cdot y
\end{array}
Initial program 86.2%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.7%
Applied egg-rr97.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.9e-33)
(+ x y)
(if (<= z 2e-96)
(+ x (* t (/ y a)))
(if (<= z 36000.0) (* (- z t) (/ y (- z a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.9e-33) {
tmp = x + y;
} else if (z <= 2e-96) {
tmp = x + (t * (y / a));
} else if (z <= 36000.0) {
tmp = (z - t) * (y / (z - a));
} 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 <= (-5.9d-33)) then
tmp = x + y
else if (z <= 2d-96) then
tmp = x + (t * (y / a))
else if (z <= 36000.0d0) then
tmp = (z - t) * (y / (z - a))
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 <= -5.9e-33) {
tmp = x + y;
} else if (z <= 2e-96) {
tmp = x + (t * (y / a));
} else if (z <= 36000.0) {
tmp = (z - t) * (y / (z - a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.9e-33: tmp = x + y elif z <= 2e-96: tmp = x + (t * (y / a)) elif z <= 36000.0: tmp = (z - t) * (y / (z - a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.9e-33) tmp = Float64(x + y); elseif (z <= 2e-96) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 36000.0) tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.9e-33) tmp = x + y; elseif (z <= 2e-96) tmp = x + (t * (y / a)); elseif (z <= 36000.0) tmp = (z - t) * (y / (z - a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.9e-33], N[(x + y), $MachinePrecision], If[LessEqual[z, 2e-96], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 36000.0], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.9 \cdot 10^{-33}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-96}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 36000:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -5.89999999999999985e-33 or 36000 < z Initial program 78.6%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6479.1%
Simplified79.1%
if -5.89999999999999985e-33 < z < 1.9999999999999998e-96Initial program 94.4%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.5%
Applied egg-rr94.5%
Taylor expanded in z around 0
/-lowering-/.f6480.1%
Simplified80.1%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6482.1%
Applied egg-rr82.1%
if 1.9999999999999998e-96 < z < 36000Initial program 99.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6486.8%
Simplified86.8%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6486.6%
Applied egg-rr86.6%
Final simplification80.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.2e-33)
(+ x y)
(if (<= z 4e-92)
(+ x (* t (/ y a)))
(if (<= z 4.45e+55) (- x (* y (/ z a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.2e-33) {
tmp = x + y;
} else if (z <= 4e-92) {
tmp = x + (t * (y / a));
} else if (z <= 4.45e+55) {
tmp = x - (y * (z / a));
} 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 <= (-6.2d-33)) then
tmp = x + y
else if (z <= 4d-92) then
tmp = x + (t * (y / a))
else if (z <= 4.45d+55) then
tmp = x - (y * (z / a))
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 <= -6.2e-33) {
tmp = x + y;
} else if (z <= 4e-92) {
tmp = x + (t * (y / a));
} else if (z <= 4.45e+55) {
tmp = x - (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.2e-33: tmp = x + y elif z <= 4e-92: tmp = x + (t * (y / a)) elif z <= 4.45e+55: tmp = x - (y * (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.2e-33) tmp = Float64(x + y); elseif (z <= 4e-92) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 4.45e+55) tmp = Float64(x - Float64(y * Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.2e-33) tmp = x + y; elseif (z <= 4e-92) tmp = x + (t * (y / a)); elseif (z <= 4.45e+55) tmp = x - (y * (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.2e-33], N[(x + y), $MachinePrecision], If[LessEqual[z, 4e-92], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.45e+55], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-33}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-92}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 4.45 \cdot 10^{+55}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -6.19999999999999994e-33 or 4.4500000000000001e55 < z Initial program 77.1%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6481.0%
Simplified81.0%
if -6.19999999999999994e-33 < z < 3.99999999999999995e-92Initial program 94.6%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.6%
Applied egg-rr94.6%
Taylor expanded in z around 0
/-lowering-/.f6479.8%
Simplified79.8%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6481.7%
Applied egg-rr81.7%
if 3.99999999999999995e-92 < z < 4.4500000000000001e55Initial program 99.8%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.7%
Applied egg-rr99.7%
Taylor expanded in t around 0
/-lowering-/.f64N/A
--lowering--.f6464.8%
Simplified64.8%
Taylor expanded in z around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6459.2%
Simplified59.2%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6459.3%
Applied egg-rr59.3%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.9e-73) (+ x y) (if (<= z 6e-226) x (if (<= z 3.2e-174) (/ (* t y) a) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-73) {
tmp = x + y;
} else if (z <= 6e-226) {
tmp = x;
} else if (z <= 3.2e-174) {
tmp = (t * y) / a;
} 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.9d-73)) then
tmp = x + y
else if (z <= 6d-226) then
tmp = x
else if (z <= 3.2d-174) then
tmp = (t * y) / a
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.9e-73) {
tmp = x + y;
} else if (z <= 6e-226) {
tmp = x;
} else if (z <= 3.2e-174) {
tmp = (t * y) / a;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.9e-73: tmp = x + y elif z <= 6e-226: tmp = x elif z <= 3.2e-174: tmp = (t * y) / a else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e-73) tmp = Float64(x + y); elseif (z <= 6e-226) tmp = x; elseif (z <= 3.2e-174) tmp = Float64(Float64(t * y) / a); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.9e-73) tmp = x + y; elseif (z <= 6e-226) tmp = x; elseif (z <= 3.2e-174) tmp = (t * y) / a; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e-73], N[(x + y), $MachinePrecision], If[LessEqual[z, 6e-226], x, If[LessEqual[z, 3.2e-174], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-73}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-226}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-174}:\\
\;\;\;\;\frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.9000000000000001e-73 or 3.2e-174 < z Initial program 83.3%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6474.3%
Simplified74.3%
if -1.9000000000000001e-73 < z < 5.9999999999999999e-226Initial program 92.9%
Taylor expanded in x around inf
Simplified56.9%
if 5.9999999999999999e-226 < z < 3.2e-174Initial program 92.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6476.2%
Simplified76.2%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6454.7%
Simplified54.7%
Final simplification68.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (+ (/ t z) -1.0)))))
(if (<= z -2.4e-75)
t_1
(if (<= z 1.25e-42) (+ x (* y (/ (- t z) a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * ((t / z) + -1.0));
double tmp;
if (z <= -2.4e-75) {
tmp = t_1;
} else if (z <= 1.25e-42) {
tmp = x + (y * ((t - z) / 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) :: tmp
t_1 = x - (y * ((t / z) + (-1.0d0)))
if (z <= (-2.4d-75)) then
tmp = t_1
else if (z <= 1.25d-42) then
tmp = x + (y * ((t - z) / 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 = x - (y * ((t / z) + -1.0));
double tmp;
if (z <= -2.4e-75) {
tmp = t_1;
} else if (z <= 1.25e-42) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * ((t / z) + -1.0)) tmp = 0 if z <= -2.4e-75: tmp = t_1 elif z <= 1.25e-42: tmp = x + (y * ((t - z) / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(Float64(t / z) + -1.0))) tmp = 0.0 if (z <= -2.4e-75) tmp = t_1; elseif (z <= 1.25e-42) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * ((t / z) + -1.0)); tmp = 0.0; if (z <= -2.4e-75) tmp = t_1; elseif (z <= 1.25e-42) tmp = x + (y * ((t - z) / a)); 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[(t / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e-75], t$95$1, If[LessEqual[z, 1.25e-42], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \left(\frac{t}{z} + -1\right)\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-42}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.40000000000000019e-75 or 1.25000000000000001e-42 < z Initial program 80.5%
Taylor expanded in a around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
*-inversesN/A
--lowering--.f64N/A
/-lowering-/.f6484.8%
Simplified84.8%
if -2.40000000000000019e-75 < z < 1.25000000000000001e-42Initial program 94.5%
Taylor expanded in a around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6484.2%
Simplified84.2%
Final simplification84.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- x (* y (+ (/ t z) -1.0))))) (if (<= z -1.35e-74) t_1 (if (<= z 4e-92) (+ x (* t (/ y a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * ((t / z) + -1.0));
double tmp;
if (z <= -1.35e-74) {
tmp = t_1;
} else if (z <= 4e-92) {
tmp = x + (t * (y / 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) :: tmp
t_1 = x - (y * ((t / z) + (-1.0d0)))
if (z <= (-1.35d-74)) then
tmp = t_1
else if (z <= 4d-92) then
tmp = x + (t * (y / 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 = x - (y * ((t / z) + -1.0));
double tmp;
if (z <= -1.35e-74) {
tmp = t_1;
} else if (z <= 4e-92) {
tmp = x + (t * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * ((t / z) + -1.0)) tmp = 0 if z <= -1.35e-74: tmp = t_1 elif z <= 4e-92: tmp = x + (t * (y / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(Float64(t / z) + -1.0))) tmp = 0.0 if (z <= -1.35e-74) tmp = t_1; elseif (z <= 4e-92) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * ((t / z) + -1.0)); tmp = 0.0; if (z <= -1.35e-74) tmp = t_1; elseif (z <= 4e-92) tmp = x + (t * (y / a)); 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[(t / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e-74], t$95$1, If[LessEqual[z, 4e-92], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \left(\frac{t}{z} + -1\right)\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{-74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-92}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.35000000000000009e-74 or 3.99999999999999995e-92 < z Initial program 81.1%
Taylor expanded in a around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
*-inversesN/A
--lowering--.f64N/A
/-lowering-/.f6484.0%
Simplified84.0%
if -1.35000000000000009e-74 < z < 3.99999999999999995e-92Initial program 94.2%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6495.2%
Applied egg-rr95.2%
Taylor expanded in z around 0
/-lowering-/.f6481.3%
Simplified81.3%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6483.4%
Applied egg-rr83.4%
Final simplification83.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.08e-42) (+ x y) (if (<= z 4.2e-92) (+ x (* t (/ y a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.08e-42) {
tmp = x + y;
} else if (z <= 4.2e-92) {
tmp = x + (t * (y / a));
} 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.08d-42)) then
tmp = x + y
else if (z <= 4.2d-92) then
tmp = x + (t * (y / a))
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.08e-42) {
tmp = x + y;
} else if (z <= 4.2e-92) {
tmp = x + (t * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.08e-42: tmp = x + y elif z <= 4.2e-92: tmp = x + (t * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.08e-42) tmp = Float64(x + y); elseif (z <= 4.2e-92) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.08e-42) tmp = x + y; elseif (z <= 4.2e-92) tmp = x + (t * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.08e-42], N[(x + y), $MachinePrecision], If[LessEqual[z, 4.2e-92], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{-42}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-92}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.07999999999999996e-42 or 4.2e-92 < z Initial program 80.3%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6474.9%
Simplified74.9%
if -1.07999999999999996e-42 < z < 4.2e-92Initial program 94.6%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.6%
Applied egg-rr94.6%
Taylor expanded in z around 0
/-lowering-/.f6479.8%
Simplified79.8%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6481.7%
Applied egg-rr81.7%
Final simplification77.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -4e+204) (- x (* y (+ (/ t z) -1.0))) (+ x (* (- z t) (/ y (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e+204) {
tmp = x - (y * ((t / z) + -1.0));
} else {
tmp = x + ((z - t) * (y / (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 <= (-4d+204)) then
tmp = x - (y * ((t / z) + (-1.0d0)))
else
tmp = x + ((z - t) * (y / (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 <= -4e+204) {
tmp = x - (y * ((t / z) + -1.0));
} else {
tmp = x + ((z - t) * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4e+204: tmp = x - (y * ((t / z) + -1.0)) else: tmp = x + ((z - t) * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e+204) tmp = Float64(x - Float64(y * Float64(Float64(t / z) + -1.0))); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4e+204) tmp = x - (y * ((t / z) + -1.0)); else tmp = x + ((z - t) * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e+204], N[(x - N[(y * N[(N[(t / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+204}:\\
\;\;\;\;x - y \cdot \left(\frac{t}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if z < -3.99999999999999996e204Initial program 65.8%
Taylor expanded in a around 0
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
*-inversesN/A
--lowering--.f64N/A
/-lowering-/.f64100.0%
Simplified100.0%
if -3.99999999999999996e204 < z Initial program 88.7%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6495.3%
Applied egg-rr95.3%
Final simplification95.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -9.5e-74) (+ x y) (if (<= z 4.5e-175) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.5e-74) {
tmp = x + y;
} else if (z <= 4.5e-175) {
tmp = x;
} 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 <= (-9.5d-74)) then
tmp = x + y
else if (z <= 4.5d-175) then
tmp = x
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 <= -9.5e-74) {
tmp = x + y;
} else if (z <= 4.5e-175) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9.5e-74: tmp = x + y elif z <= 4.5e-175: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.5e-74) tmp = Float64(x + y); elseif (z <= 4.5e-175) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -9.5e-74) tmp = x + y; elseif (z <= 4.5e-175) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.5e-74], N[(x + y), $MachinePrecision], If[LessEqual[z, 4.5e-175], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-74}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-175}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -9.5000000000000007e-74 or 4.49999999999999998e-175 < z Initial program 83.4%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6473.9%
Simplified73.9%
if -9.5000000000000007e-74 < z < 4.49999999999999998e-175Initial program 92.7%
Taylor expanded in x around inf
Simplified51.7%
Final simplification67.2%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.55e-192) x (if (<= x 2.8e-235) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.55e-192) {
tmp = x;
} else if (x <= 2.8e-235) {
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 <= (-1.55d-192)) then
tmp = x
else if (x <= 2.8d-235) 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 <= -1.55e-192) {
tmp = x;
} else if (x <= 2.8e-235) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.55e-192: tmp = x elif x <= 2.8e-235: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.55e-192) tmp = x; elseif (x <= 2.8e-235) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.55e-192) tmp = x; elseif (x <= 2.8e-235) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.55e-192], x, If[LessEqual[x, 2.8e-235], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{-192}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-235}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.55e-192 or 2.79999999999999995e-235 < x Initial program 86.6%
Taylor expanded in x around inf
Simplified60.8%
if -1.55e-192 < x < 2.79999999999999995e-235Initial program 84.4%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6474.1%
Simplified74.1%
Taylor expanded in z around inf
Simplified42.3%
(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 86.2%
Taylor expanded in x around inf
Simplified52.5%
(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 2024152
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (/ (* y (- z t)) (- z a))))