
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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 * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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 * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.4e+198) (not (<= z 6.9e+100))) (/ (- (/ x z) y) (- a)) (/ (- x (* y z)) (- t (* a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.4e+198) || !(z <= 6.9e+100)) {
tmp = ((x / z) - y) / -a;
} else {
tmp = (x - (y * z)) / (t - (a * z));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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 <= (-4.4d+198)) .or. (.not. (z <= 6.9d+100))) then
tmp = ((x / z) - y) / -a
else
tmp = (x - (y * z)) / (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 <= -4.4e+198) || !(z <= 6.9e+100)) {
tmp = ((x / z) - y) / -a;
} else {
tmp = (x - (y * z)) / (t - (a * z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.4e+198) or not (z <= 6.9e+100): tmp = ((x / z) - y) / -a else: tmp = (x - (y * z)) / (t - (a * z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.4e+198) || !(z <= 6.9e+100)) tmp = Float64(Float64(Float64(x / z) - y) / Float64(-a)); else tmp = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.4e+198) || ~((z <= 6.9e+100))) tmp = ((x / z) - y) / -a; else tmp = (x - (y * z)) / (t - (a * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.4e+198], N[Not[LessEqual[z, 6.9e+100]], $MachinePrecision]], N[(N[(N[(x / z), $MachinePrecision] - y), $MachinePrecision] / (-a)), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+198} \lor \neg \left(z \leq 6.9 \cdot 10^{+100}\right):\\
\;\;\;\;\frac{\frac{x}{z} - y}{-a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t - a \cdot z}\\
\end{array}
\end{array}
if z < -4.3999999999999999e198 or 6.9000000000000001e100 < z Initial program 51.2%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift--.f6465.8
Applied rewrites65.8%
Taylor expanded in a around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6483.4
Applied rewrites83.4%
if -4.3999999999999999e198 < z < 6.9000000000000001e100Initial program 94.9%
Final simplification92.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* a z))))
(if (<= (/ (- x (* y z)) t_1) INFINITY)
(- (/ x t_1) (* y (/ z t_1)))
(/ y a))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double tmp;
if (((x - (y * z)) / t_1) <= ((double) INFINITY)) {
tmp = (x / t_1) - (y * (z / t_1));
} else {
tmp = y / a;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double tmp;
if (((x - (y * z)) / t_1) <= Double.POSITIVE_INFINITY) {
tmp = (x / t_1) - (y * (z / t_1));
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (a * z) tmp = 0 if ((x - (y * z)) / t_1) <= math.inf: tmp = (x / t_1) - (y * (z / t_1)) else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(a * z)) tmp = 0.0 if (Float64(Float64(x - Float64(y * z)) / t_1) <= Inf) tmp = Float64(Float64(x / t_1) - Float64(y * Float64(z / t_1))); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (a * z); tmp = 0.0; if (((x - (y * z)) / t_1) <= Inf) tmp = (x / t_1) - (y * (z / t_1)); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], Infinity], N[(N[(x / t$95$1), $MachinePrecision] - N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - a \cdot z\\
\mathbf{if}\;\frac{x - y \cdot z}{t\_1} \leq \infty:\\
\;\;\;\;\frac{x}{t\_1} - y \cdot \frac{z}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 87.5%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift--.f6491.0
Applied rewrites91.0%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
Taylor expanded in z around inf
lower-/.f64100.0
Applied rewrites100.0%
Final simplification91.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.6e-24) (not (<= z 1.85e-8))) (/ (- (/ x z) y) (- a)) (/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.6e-24) || !(z <= 1.85e-8)) {
tmp = ((x / z) - y) / -a;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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.6d-24)) .or. (.not. (z <= 1.85d-8))) then
tmp = ((x / z) - y) / -a
else
tmp = (x - (y * 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 <= -1.6e-24) || !(z <= 1.85e-8)) {
tmp = ((x / z) - y) / -a;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.6e-24) or not (z <= 1.85e-8): tmp = ((x / z) - y) / -a else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.6e-24) || !(z <= 1.85e-8)) tmp = Float64(Float64(Float64(x / z) - y) / Float64(-a)); else tmp = Float64(Float64(x - Float64(y * z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.6e-24) || ~((z <= 1.85e-8))) tmp = ((x / z) - y) / -a; else tmp = (x - (y * z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.6e-24], N[Not[LessEqual[z, 1.85e-8]], $MachinePrecision]], N[(N[(N[(x / z), $MachinePrecision] - y), $MachinePrecision] / (-a)), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-24} \lor \neg \left(z \leq 1.85 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{\frac{x}{z} - y}{-a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if z < -1.60000000000000006e-24 or 1.85e-8 < z Initial program 70.9%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift--.f6481.1
Applied rewrites81.1%
Taylor expanded in a around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6475.8
Applied rewrites75.8%
if -1.60000000000000006e-24 < z < 1.85e-8Initial program 99.8%
Taylor expanded in z around 0
Applied rewrites72.8%
Final simplification74.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* a z))))
(if (<= y -1.9e-112)
(/ (* (- y) z) t_1)
(if (<= y 175.0) (/ x t_1) (* (- y) (/ z t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double tmp;
if (y <= -1.9e-112) {
tmp = (-y * z) / t_1;
} else if (y <= 175.0) {
tmp = x / t_1;
} else {
tmp = -y * (z / t_1);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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 = t - (a * z)
if (y <= (-1.9d-112)) then
tmp = (-y * z) / t_1
else if (y <= 175.0d0) then
tmp = x / t_1
else
tmp = -y * (z / 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 = t - (a * z);
double tmp;
if (y <= -1.9e-112) {
tmp = (-y * z) / t_1;
} else if (y <= 175.0) {
tmp = x / t_1;
} else {
tmp = -y * (z / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (a * z) tmp = 0 if y <= -1.9e-112: tmp = (-y * z) / t_1 elif y <= 175.0: tmp = x / t_1 else: tmp = -y * (z / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(a * z)) tmp = 0.0 if (y <= -1.9e-112) tmp = Float64(Float64(Float64(-y) * z) / t_1); elseif (y <= 175.0) tmp = Float64(x / t_1); else tmp = Float64(Float64(-y) * Float64(z / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (a * z); tmp = 0.0; if (y <= -1.9e-112) tmp = (-y * z) / t_1; elseif (y <= 175.0) tmp = x / t_1; else tmp = -y * (z / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.9e-112], N[(N[((-y) * z), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y, 175.0], N[(x / t$95$1), $MachinePrecision], N[((-y) * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - a \cdot z\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{-112}:\\
\;\;\;\;\frac{\left(-y\right) \cdot z}{t\_1}\\
\mathbf{elif}\;y \leq 175:\\
\;\;\;\;\frac{x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) \cdot \frac{z}{t\_1}\\
\end{array}
\end{array}
if y < -1.89999999999999997e-112Initial program 85.9%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6458.0
Applied rewrites58.0%
if -1.89999999999999997e-112 < y < 175Initial program 92.2%
Taylor expanded in x around inf
Applied rewrites82.4%
if 175 < y Initial program 74.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f6474.5
Applied rewrites74.5%
Taylor expanded in x around 0
mul-1-negN/A
associate-*r/N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift--.f6464.4
Applied rewrites64.4%
Final simplification69.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* a z))))
(if (<= y -1.1e-91)
(/ (- x (* y z)) t)
(if (<= y 175.0) (/ x t_1) (* (- y) (/ z t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double tmp;
if (y <= -1.1e-91) {
tmp = (x - (y * z)) / t;
} else if (y <= 175.0) {
tmp = x / t_1;
} else {
tmp = -y * (z / t_1);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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 = t - (a * z)
if (y <= (-1.1d-91)) then
tmp = (x - (y * z)) / t
else if (y <= 175.0d0) then
tmp = x / t_1
else
tmp = -y * (z / 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 = t - (a * z);
double tmp;
if (y <= -1.1e-91) {
tmp = (x - (y * z)) / t;
} else if (y <= 175.0) {
tmp = x / t_1;
} else {
tmp = -y * (z / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (a * z) tmp = 0 if y <= -1.1e-91: tmp = (x - (y * z)) / t elif y <= 175.0: tmp = x / t_1 else: tmp = -y * (z / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(a * z)) tmp = 0.0 if (y <= -1.1e-91) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (y <= 175.0) tmp = Float64(x / t_1); else tmp = Float64(Float64(-y) * Float64(z / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (a * z); tmp = 0.0; if (y <= -1.1e-91) tmp = (x - (y * z)) / t; elseif (y <= 175.0) tmp = x / t_1; else tmp = -y * (z / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.1e-91], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 175.0], N[(x / t$95$1), $MachinePrecision], N[((-y) * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - a \cdot z\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{-91}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;y \leq 175:\\
\;\;\;\;\frac{x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) \cdot \frac{z}{t\_1}\\
\end{array}
\end{array}
if y < -1.1e-91Initial program 85.6%
Taylor expanded in z around 0
Applied rewrites57.4%
if -1.1e-91 < y < 175Initial program 92.3%
Taylor expanded in x around inf
Applied rewrites80.9%
if 175 < y Initial program 74.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f6474.5
Applied rewrites74.5%
Taylor expanded in x around 0
mul-1-negN/A
associate-*r/N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift--.f6464.4
Applied rewrites64.4%
Final simplification68.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.45e+22) (not (<= z 1e+50))) (/ y a) (/ x (- t (* a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.45e+22) || !(z <= 1e+50)) {
tmp = y / a;
} else {
tmp = x / (t - (a * z));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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.45d+22)) .or. (.not. (z <= 1d+50))) then
tmp = y / a
else
tmp = x / (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.45e+22) || !(z <= 1e+50)) {
tmp = y / a;
} else {
tmp = x / (t - (a * z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.45e+22) or not (z <= 1e+50): tmp = y / a else: tmp = x / (t - (a * z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.45e+22) || !(z <= 1e+50)) tmp = Float64(y / a); else tmp = Float64(x / Float64(t - Float64(a * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.45e+22) || ~((z <= 1e+50))) tmp = y / a; else tmp = x / (t - (a * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.45e+22], N[Not[LessEqual[z, 1e+50]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+22} \lor \neg \left(z \leq 10^{+50}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - a \cdot z}\\
\end{array}
\end{array}
if z < -1.45e22 or 1.0000000000000001e50 < z Initial program 65.2%
Taylor expanded in z around inf
lower-/.f6458.9
Applied rewrites58.9%
if -1.45e22 < z < 1.0000000000000001e50Initial program 99.1%
Taylor expanded in x around inf
Applied rewrites68.7%
Final simplification64.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.6e-24)
(/ y a)
(if (<= z -1.25e-89)
(/ (* (- y) z) t)
(if (<= z 9.2e-103) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e-24) {
tmp = y / a;
} else if (z <= -1.25e-89) {
tmp = (-y * z) / t;
} else if (z <= 9.2e-103) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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.6d-24)) then
tmp = y / a
else if (z <= (-1.25d-89)) then
tmp = (-y * z) / t
else if (z <= 9.2d-103) then
tmp = x / t
else
tmp = 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 <= -1.6e-24) {
tmp = y / a;
} else if (z <= -1.25e-89) {
tmp = (-y * z) / t;
} else if (z <= 9.2e-103) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.6e-24: tmp = y / a elif z <= -1.25e-89: tmp = (-y * z) / t elif z <= 9.2e-103: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e-24) tmp = Float64(y / a); elseif (z <= -1.25e-89) tmp = Float64(Float64(Float64(-y) * z) / t); elseif (z <= 9.2e-103) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.6e-24) tmp = y / a; elseif (z <= -1.25e-89) tmp = (-y * z) / t; elseif (z <= 9.2e-103) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e-24], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.25e-89], N[(N[((-y) * z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 9.2e-103], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-24}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-89}:\\
\;\;\;\;\frac{\left(-y\right) \cdot z}{t}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-103}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.60000000000000006e-24 or 9.2000000000000003e-103 < z Initial program 74.8%
Taylor expanded in z around inf
lower-/.f6453.2
Applied rewrites53.2%
if -1.60000000000000006e-24 < z < -1.24999999999999992e-89Initial program 99.5%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6446.3
Applied rewrites46.3%
Taylor expanded in z around 0
Applied rewrites46.3%
if -1.24999999999999992e-89 < z < 9.2000000000000003e-103Initial program 99.9%
Taylor expanded in z around 0
lower-/.f6464.1
Applied rewrites64.1%
Final simplification56.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.6e-24) (not (<= z 9.2e-103))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.6e-24) || !(z <= 9.2e-103)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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.6d-24)) .or. (.not. (z <= 9.2d-103))) then
tmp = y / a
else
tmp = x / 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 <= -1.6e-24) || !(z <= 9.2e-103)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.6e-24) or not (z <= 9.2e-103): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.6e-24) || !(z <= 9.2e-103)) tmp = Float64(y / a); else tmp = Float64(x / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.6e-24) || ~((z <= 9.2e-103))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.6e-24], N[Not[LessEqual[z, 9.2e-103]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-24} \lor \neg \left(z \leq 9.2 \cdot 10^{-103}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -1.60000000000000006e-24 or 9.2000000000000003e-103 < z Initial program 74.8%
Taylor expanded in z around inf
lower-/.f6453.2
Applied rewrites53.2%
if -1.60000000000000006e-24 < z < 9.2000000000000003e-103Initial program 99.8%
Taylor expanded in z around 0
lower-/.f6456.1
Applied rewrites56.1%
Final simplification54.4%
(FPCore (x y z t a) :precision binary64 (/ x t))
double code(double x, double y, double z, double t, double a) {
return x / t;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
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 / t
end function
public static double code(double x, double y, double z, double t, double a) {
return x / t;
}
def code(x, y, z, t, a): return x / t
function code(x, y, z, t, a) return Float64(x / t) end
function tmp = code(x, y, z, t, a) tmp = x / t; end
code[x_, y_, z_, t_, a_] := N[(x / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{t}
\end{array}
Initial program 84.8%
Taylor expanded in z around 0
lower-/.f6432.2
Applied rewrites32.2%
Final simplification32.2%
herbie shell --seed 2025085
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:alt
(! :herbie-platform default (if (< z -32113435955957344) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 4392440296622287/125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* (- x (* y z)) (/ 1 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))))))
(/ (- x (* y z)) (- t (* a z))))